This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xxm
Recipients xxm
Date 2020-12-14.06:02:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1607925772.13.0.935744871681.issue42632@roundup.psfhosted.org>
In-reply-to
Content
Running the following program:
==============================
def foo():
    try:
        1/0
    except ZeroDivisionError as e:
       	ZeroDivisionError = 1
foo()
==============================
The expected output should be nothing. ZeroDivisionError is caught and then reassignment is executed. However, running this program in Python3.10 will lead to the following error: 

Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/error/1.py", line 5, in foo
    1/0
ZeroDivisionError: division by zero

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/xxm/Desktop/nameChanging/error/1.py", line 8, in <module>
    foo()
  File "/home/xxm/Desktop/nameChanging/error/1.py", line 6, in foo
    except Exception as e:
UnboundLocalError: local variable 'Exception' referenced before assignment
History
Date User Action Args
2020-12-14 06:02:52xxmsetrecipients: + xxm
2020-12-14 06:02:52xxmsetmessageid: <1607925772.13.0.935744871681.issue42632@roundup.psfhosted.org>
2020-12-14 06:02:52xxmlinkissue42632 messages
2020-12-14 06:02:51xxmcreate