Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Bug description:
The code for the following AST is:
typefoo['x']=Callable
compiling the AST for the given code results in a segmentation fault
fromastimport*m=Module(body=[TypeAlias(name=Subscript(value=Name(id="foo",ctx=Load()),slice=Constant(value="x"),ctx=Store(), ),type_params=[],value=Name(id="Callable",ctx=Load()), ) ],type_ignores=[],)compile(fix_missing_locations(m),"<file>","exec")
output (Python 3.12.0rc2+):
fish: Job 1, 'venv3.12/bin/python bug.py' terminated by signal SIGSEGV (Adressbereichsfehler)Compiling the code gives the correct syntax error.
compile("type foo['x'] = Callable","<file>","exec")
output (Python 3.12.0rc2+):
Traceback (most recent call last): File "/home/frank/projects/executing/bug.py", line 1, in <module> compile("type foo['x'] = Callable","<file>","exec") File "<file>", line 1 type foo['x'] = Callable ^^^SyntaxError: invalid syntaxCPython versions tested on:
3.12
Operating systems tested on:
No response