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   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://boredomandlaziness.skystorm.net
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to