Skip to content

[3.8] bpo-40807: Backport test_codeop change [GH-19670] #20646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Lib/test/test_codeop.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Nick Mathewson
"""
import unittest
from test.support import is_jython
from test import support

from codeop import compile_command, PyCF_DONT_IMPLY_DEDENT
import io

if is_jython:
if support.is_jython:
import sys

def unify_callables(d):
Expand All @@ -21,7 +21,7 @@ class CodeopTests(unittest.TestCase):

def assertValid(self, str, symbol='single'):
'''succeed iff str is a valid piece of code'''
if is_jython:
if support.is_jython:
code = compile_command(str, "<input>", symbol)
self.assertTrue(code)
if symbol == "single":
Expand Down Expand Up @@ -60,7 +60,7 @@ def test_valid(self):
av = self.assertValid

# special case
if not is_jython:
if not support.is_jython:
self.assertEqual(compile_command(""),
compile("pass", "<input>", 'single',
PyCF_DONT_IMPLY_DEDENT))
Expand Down