mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-40614: Respect feature version for f-string debug expressions (GH-20196)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
This commit is contained in:
parent
db5aed931f
commit
c116c94ff1
4 changed files with 17 additions and 0 deletions
|
|
@ -663,6 +663,11 @@ class AST_Tests(unittest.TestCase):
|
|||
expressions[0] = f"expr = {ast.expr.__subclasses__()[0].__doc__}"
|
||||
self.assertCountEqual(ast.expr.__doc__.split("\n"), expressions)
|
||||
|
||||
def test_issue40614_feature_version(self):
|
||||
ast.parse('f"{x=}"', feature_version=(3, 8))
|
||||
with self.assertRaises(SyntaxError):
|
||||
ast.parse('f"{x=}"', feature_version=(3, 7))
|
||||
|
||||
|
||||
class ASTHelpers_Test(unittest.TestCase):
|
||||
maxDiff = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue