class documentation

class safe_reraise: (source)

View In Hierarchy

Reraise an exception after invoking some handler code. Stores the existing exception info before invoking so that it is maintained across a potential coroutine context switch. e.g.:: try: sess.commit() except: with safe_reraise(): sess.rollback() TODO: we should at some point evaluate current behaviors in this regard based on current greenlet, gevent/eventlet implementations in Python 3, and also see the degree to which our own asyncio (based on greenlet also) is impacted by this. .rollback() will cause IO / context switch to occur in all these scenarios; what happens to the exception context from an "except:" block if we don't explicitly store it? Original issue was #2703.

Method __enter__ Undocumented
Method __exit__ Undocumented
Class Variable __slots__ Undocumented
Instance Variable _exc_info Undocumented
def __enter__(self): (source)

Undocumented

Undocumented

__slots__: tuple[str, ...] = (source)

Undocumented

_exc_info = (source)

Undocumented