Message368818
```
~/dev/cpython master λ ./python.exe --version --version
Python 3.9.0a6+ (heads/master:a15c9b3a05, May 14 2020, 00:31:47)
[Clang 11.0.0 (clang-1100.0.33.17)]
# should raise a syntax error, instead crashes
~/dev/cpython master λ cat test.py
try:
1 / 0
except Exception as a.b:
pass
~/dev/cpython master λ ./python.exe test.py
[1] 63986 bus error ./python.exe test.py
~/dev/cpython master λ ./python.exe -Xoldparser test.py
File "/Users/shantanu/dev/cpython/test.py", line 3
except Exception as a.b:
^
SyntaxError: invalid syntax
# should raise a syntax error, instead passes
~/dev/cpython master λ cat test2.py
try:
1 / 0
except Exception as (a):
pass
~/dev/cpython master λ ./python.exe test2.py
~/dev/cpython master λ ./python.exe -Xoldparser test2.py
File "/Users/shantanu/dev/cpython/test2.py", line 3
except Exception as (a):
^
SyntaxError: invalid syntax
# should raise a syntax error, instead crashes
~/dev/cpython master λ cat test3.py
try:
1 / 0
except Exception as a[0]:
pass
~/dev/cpython master λ ./python.exe test3.py
[1] 64206 bus error ./python.exe test3.py
~/dev/cpython master λ ./python.exe -Xoldparser test3.py
File "/Users/shantanu/dev/cpython/test3.py", line 3
except Exception as a[0]:
^
SyntaxError: invalid syntax
```
The old grammar expects a NAME here, but the new grammar attempts to use a target (https://docs.python.org/3/reference/grammar.html). Seems like we should just go back to using NAME. |
|
Date |
User |
Action |
Args |
2020-05-14 07:40:23 | hauntsaninja | set | recipients:
+ hauntsaninja |
2020-05-14 07:40:23 | hauntsaninja | set | messageid: <1589442023.75.0.251315852279.issue40621@roundup.psfhosted.org> |
2020-05-14 07:40:23 | hauntsaninja | link | issue40621 messages |
2020-05-14 07:40:23 | hauntsaninja | create | |
|