gh-101928: fix crash in compiler on multi-line lambda in function call (#101933)

This commit is contained in:
penguin_wwy 2023-02-16 19:31:41 +08:00 committed by GitHub
parent 0b13575e74
commit df7ccf6138
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View file

@ -1155,6 +1155,17 @@ if 1:
with self.subTest(expr=expr):
compile(expr, "<single>", "exec")
def test_multi_line_lambda_as_argument(self):
# See gh-101928
compile("""
def foo(param, lambda_exp):
pass
foo(param=0,
lambda_exp=lambda:
1)
""", "<test>", "exec")
@requires_debug_ranges()
class TestSourcePositions(unittest.TestCase):