[Python-checkins] [3.8] bpo-40807: Backport test_codeop change [GH-19670]
Miss Islington (bot)
webhook-mailer at python.org
Thu Jun 4 23:00:59 EDT 2020
https://github.com/python/cpython/commit/12d3061c7819a73d891dcce44327410eaf0e1bc2
commit: 12d3061c7819a73d891dcce44327410eaf0e1bc2
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020年06月04日T23:00:47-04:00
summary:
[3.8] bpo-40807: Backport test_codeop change [GH-19670]
A tiny sliver of a 3.9 PEG parser patch needed to backport the test added by GH-20486.
(cherry picked from commit a5d6aba318ead9cc756ba750a70da41f5def3f8f)
Co-authored-by: Terry Jan Reedy <tjreedy at udel.edu>
files:
M Lib/test/test_codeop.py
diff --git a/Lib/test/test_codeop.py b/Lib/test/test_codeop.py
index 98da26fa5dab1..4d52d15fa0fb3 100644
--- a/Lib/test/test_codeop.py
+++ b/Lib/test/test_codeop.py
@@ -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):
@@ -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":
@@ -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))
More information about the Python-checkins
mailing list