Author jcea
Recipients Mark.Gius, gregory.p.smith, jcea, neologix
Date 2012-10-26.01:18:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1351214287.23.0.662885928297.issue16327@psf.upfronthosting.co.za>
In-reply-to
Content
In fact, nested exception management in python 2 and python 3 actually diverges. BEWARE: (Python 3 does the right thing, once again :-)

"""
Python 2.7.3 (default, Apr 12 2012, 13:11:53) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> try :
...   1/0
... except :
...   try :
...     raise RuntimeError("TEST")
...   except :
...     pass
...   raise
... 
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
RuntimeError: TEST
"""

"""
Python 3.3.0 (default, Oct  2 2012, 02:07:16) 
[GCC 4.4.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> try :
...   1/0
... except :
...   try :
...     raise RuntimeError("TEST")
...   except :
...     pass
...   raise
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
ZeroDivisionError: division by zero
"""
History
Date User Action Args
2012-10-26 01:18:07jceasetrecipients: + jcea, gregory.p.smith, neologix, Mark.Gius
2012-10-26 01:18:07jceasetmessageid: <1351214287.23.0.662885928297.issue16327@psf.upfronthosting.co.za>
2012-10-26 01:18:07jcealinkissue16327 messages
2012-10-26 01:18:06jceacreate