pyrefly icon indicating copy to clipboard operation
pyrefly copied to clipboard

Del the name of the exception at the end of the exception handler

Open grievejia opened this issue 11 months ago • 2 comments

Minimal repro:

try:
    1 / 0
except Exception as e:
    pass
print(e)

Expected: Name e is uninitialized at the print statement Actual: No error

grievejia avatar May 02 '25 22:05 grievejia

Are other names defined in the except block also out of scope after it ends?

yangdanny97 avatar May 02 '25 23:05 yangdanny97

No just the name of the exception.

grievejia avatar May 02 '25 23:05 grievejia