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 ezio.melotti
Recipients ezio.melotti, scoder
Date 2010-03-13.08:00:36
SpamBayes Score 3.2946646e-06
Marked as misclassified No
Message-id <1268467238.16.0.748835612336.issue8130@psf.upfronthosting.co.za>
In-reply-to
Content
In this case I don't see much difference between deleting a variable or assigning it to something else.

This code works on both Python 2 and 3:
>>> e = 'test'
>>> try: pass                    # no errors raised here
... except Exception as e: pass  # this is not executed
...
>>> e
'test'

If you do this instead:
>>> e = 'test'
>>> try: raise ValueError        # raise the error
... except Exception as e: pass  # this is executed
...

On both 2.x and 3.x 'e' doesn't refer to 'test' anymore in the moment that the exception is captured by the except, so what happens next to the "new e" is not related to what the "old e" was.
History
Date User Action Args
2010-03-13 08:00:38ezio.melottisetrecipients: + ezio.melotti, scoder
2010-03-13 08:00:38ezio.melottisetmessageid: <1268467238.16.0.748835612336.issue8130@psf.upfronthosting.co.za>
2010-03-13 08:00:36ezio.melottilinkissue8130 messages
2010-03-13 08:00:36ezio.melotticreate