Browse Source
For this, needed to implement DELETE_NAME bytecode (because var bound in except clause is automatically deleted at its end). http://docs.python.org/3/reference/compound_stmts.html#except : "When an exception has been assigned using as target, it is cleared at the end of the except clause."pull/367/head
Paul Sokolovsky
11 years ago
4 changed files with 21 additions and 0 deletions
@ -0,0 +1,10 @@ |
|||||
|
try: |
||||
|
raise ValueError(534) |
||||
|
except ValueError as e: |
||||
|
print(repr(e)) |
||||
|
|
||||
|
# Var bound in except block is automatically deleted |
||||
|
try: |
||||
|
e |
||||
|
except NameError: |
||||
|
print("NameError") |
Loading…
Reference in new issue