Closed as duplicate of#128396
Description
Crash report
What happened?
def f():
lambda: k
k = 1
print([locals() for k in [0]])
f()
Was reported on https://discuss.python.org/t/segfault-in-calling-locals-within-list-comprehension/81681
Tested on macOS and Fedora 41.
CPython versions tested on:
3.13
Operating systems tested on:
macOS
Output from running 'python -VV' on the command line:
Python 3.13.0 (v3.13.0:60403a5409f, Oct 7 2024, 00:37:40) [Clang 15.0.0 (clang-1500.3.9.4)]