summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/ast.py2
-rw-r--r--Lib/test/test_type_comments.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/Lib/ast.py b/Lib/ast.py
index 70fbbdd..ffeba17 100644
--- a/Lib/ast.py
+++ b/Lib/ast.py
@@ -45,7 +45,7 @@ def parse(source, filename='<unknown>', mode='exec', *,
feature_version = -1
# Else it should be an int giving the minor version for 3.x.
return compile(source, filename, mode, flags,
- feature_version=feature_version)
+ _feature_version=feature_version)
def literal_eval(node_or_string):
diff --git a/Lib/test/test_type_comments.py b/Lib/test/test_type_comments.py
index 55b54e7..43be54e 100644
--- a/Lib/test/test_type_comments.py
+++ b/Lib/test/test_type_comments.py
@@ -228,8 +228,9 @@ class TypeCommentTests(unittest.TestCase):
feature_version=feature_version)
def parse_all(self, source, minver=lowest, maxver=highest, expected_regex=""):
- for feature_version in range(self.lowest, self.highest + 1):
- if minver <= feature_version <= maxver:
+ for version in range(self.lowest, self.highest + 1):
+ feature_version = (3, version)
+ if minver <= version <= maxver:
try:
yield self.parse(source, feature_version)
except SyntaxError as err: