Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content
Closed
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
Next Next commit
test_syntax: add try-except cases that crash with the new parser
  • Loading branch information
hauntsaninja
hauntsaninja committed May 14, 2020
commit 490a79e970cae91d1383a9081186b0b809be6da5
25 changes: 25 additions & 0 deletions Lib/test/test_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,31 @@
...
SyntaxError: no binding for nonlocal '_A__x' found

Tests for try-except clauses:
>>> try:
... ...
... except Exception as a.b:
... pass
Traceback (most recent call last):
...
SyntaxError: invalid syntax

>>> try:
... ...
... except Exception as a[0]:
... pass
Traceback (most recent call last):
...
SyntaxError: invalid syntax

>>> try:
... ...
... except Exception as (a):
... pass
Traceback (most recent call last):
...
SyntaxError: invalid syntax


This tests assignment-context; there was a bug in Python 2.5 where compiling
a complex 'if' (one with 'elif') would fail to notice an invalid suite,
Expand Down