diff options
author | elie <elie> | 2013-06-04 06:06:23 +0000 |
---|---|---|
committer | elie <elie> | 2013-06-04 06:06:23 +0000 |
commit | 4c2d9204afc8380295a2e056d91de7acdd3bb4a0 (patch) | |
tree | b84938445fc6253644eeecc6df895d04aca859f2 /pysnmp/smi | |
parent | 55da3184ea370ee23f0ba764edb68bfb2d150b94 (diff) | |
download | pysnmp-4c2d9204afc8380295a2e056d91de7acdd3bb4a0.tar.gz |
traceback formatting improved
Diffstat (limited to 'pysnmp/smi')
-rw-r--r-- | pysnmp/smi/builder.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pysnmp/smi/builder.py b/pysnmp/smi/builder.py index 8458866..214d723 100644 --- a/pysnmp/smi/builder.py +++ b/pysnmp/smi/builder.py @@ -1,5 +1,5 @@ # MIB modules loader -import os, sys, imp, struct, marshal, time +import os, sys, imp, struct, marshal, time, traceback from pysnmp.smi import error from pysnmp import debug @@ -90,7 +90,13 @@ class __AbstractMibSource: return self._getData(f+pySfx, pyMode), pySfx raise IOError('No suitable module found') - + + # Interfaces for subclasses + def _init(self): raise NotImplementedError() + def _listdir(self): raise NotImplementedError() + def _getTimestamp(self, f): raise NotImplementedError() + def _getData(self, f, mode=None): NotImplementedError() + class ZipMibSource(__AbstractMibSource): def _init(self): try: @@ -250,7 +256,7 @@ class MibBuilder: except Exception: del self.__modPathsSeen[modPath] raise error.SmiError( - 'MIB module \"%s\" load error: %s' % (modPath, sys.exc_info()[1]) + 'MIB module \"%s\" load error: %s' % (modPath, traceback.format_exception(*sys.exc_info())) ) self.__modSeen[modName] = modPath |