Bernhard Herzog wrote: > With the proposed implementation of PEP 310 rev. 1.5 it wouldn't work. > sys.exc_info returns a tuple of Nones unless an except: clause has been > entered. Either sys.exc_info() would have to be changed to always > return exception information after an exception has been raised or the > implementation would have to be changed to do the equivalent of e.g. Interesting. Although the 'null' except block should probably be a bare 'raise', rather than a 'pass': Py> try: ... try: ... raise TypeError("I'm an error!") ... except: ... raise ... finally: ... print sys.exc_info() ... (<class exceptions.TypeError at 0x009745A0>, <exceptions.TypeError instance at 0 x009E7238>, <traceback object at 0x009E72B0>) Traceback (most recent call last): File "<stdin>", line 3, in ? TypeError: I'm an error! All the more reason to consider switching to a nested try/finally + try/except/else definition for 'with' blocks, I guess. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://boredomandlaziness.skystorm.net
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