Nick Coghlan wrote: > On Fri, Feb 4, 2011 at 8:01 AM, brett.cannon <python-checkins at python.org> wrote: >> +Capturing the Currently Raised Exception >> +---------------------------------------- >> +One change between Python 2 and 3 that will require changing how you code is >> +accessing the currently raised exception. In Python 2 the syntax to access the >> +current exception is:: I think that the semantic change is *much* more important that the syntax change. In 2.6: >>> try: ... len(None) ... except TypeError as e: ... pass ... >>> e TypeError("object of type 'NoneType' has no len()",) In 3.1: >>> try: ... len(None) ... except TypeError as e: ... pass ... >>> e Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'e' is not defined -- Steven
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4