diff options
author | elie <elie> | 2013-06-10 15:56:16 +0000 |
---|---|---|
committer | elie <elie> | 2013-06-10 15:56:16 +0000 |
commit | ec8b127d86fd1300dfb13aa54522015b33f8cf7b (patch) | |
tree | bb276d216c01beffab19b2a0582e8bbbac862a8f /pysnmp/smi/instrum.py | |
parent | 394d8d9c247e5a1bd1eee61e8b049281038f6f63 (diff) | |
download | pysnmp-git-ec8b127d86fd1300dfb13aa54522015b33f8cf7b.tar.gz |
do not re-raise exceptions with original traceback as it breaks
py3k compatibility
instead log the original traceback into debug routine
Diffstat (limited to 'pysnmp/smi/instrum.py')
-rw-r--r-- | pysnmp/smi/instrum.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pysnmp/smi/instrum.py b/pysnmp/smi/instrum.py index a7605d41..0c636619 100644 --- a/pysnmp/smi/instrum.py +++ b/pysnmp/smi/instrum.py @@ -1,5 +1,6 @@ # MIB modules management import sys +import traceback from pysnmp.smi import error from pysnmp import debug @@ -218,7 +219,7 @@ class MibInstrumController(AbstractMibInstrumController): if origExc is None: # Take the first exception origExc, origTraceback = sys.exc_info()[1:3] status = 'err' - debug.logger & debug.flagIns and debug.logger('flipFlopFsm: fun %s failed %s for %s=%r' % (f, origExc, name, val)) + debug.logger & debug.flagIns and debug.logger('flipFlopFsm: fun %s failed %s for %s=%r with traceback: %s' % (f, origExc, name, val, traceback.format_exc(origTraceback))) break else: debug.logger & debug.flagIns and debug.logger('flipFlopFsm: fun %s suceeded for %s=%r' % (f, name, val)) @@ -227,7 +228,7 @@ class MibInstrumController(AbstractMibInstrumController): idx = idx + 1 if origExc: if sys.version_info[0] <= 2: - raise origExc, None, origTraceback + raise origExc else: try: raise origExc.with_traceback(origTraceback) |