Allows:
chain_ex(add_ex_tb(ex2), ex)
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
str_type = str
def add_ex_tb(ex):
- pass
+ """Do nothing (already handled by Python 3 infrastructure)."""
+ return ex
def chain_ex(ex, context_ex):
return ex
str_type = basestring
def add_ex_tb(ex):
+ """Add a traceback to ex if it doesn't already have one. Return ex.
+
+ """
if not getattr(ex, '__traceback__', None):
ex.__traceback__ = sys.exc_info()[2]
+ return ex
def chain_ex(ex, context_ex):
if context_ex: