10000 gh-101928: fix crash in compiler on multi-line lambda in function call by penguin-wwy · Pull Request #101933 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

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 3 commits into from
Feb 16, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add unittest
  • Loading branch information
penguin-wwy committed Feb 16, 2023
commit a0822855418be733d7b29405d065cc43bf7c22c5
11 changes: 11 additions & 0 deletions Lib/test/test_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,17 @@ def test_if_expression_expression_empty_block(self):
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):
Expand Down
0