summaryrefslogtreecommitdiff
path: root/pysnmp/smi/builder.py
diff options
context:
space:
mode:
authorelie <elie>2013-06-04 06:06:23 +0000
committerelie <elie>2013-06-04 06:06:23 +0000
commitb7c4ef6e38d81a9a6afb92eda07fa4c480b77fbf (patch)
tree3884180e62c62e714645e335a2b9e05d321070a9 /pysnmp/smi/builder.py
parent5df996f4cfac0135817adef1c394bdc9b154b8fa (diff)
downloadpysnmp-git-b7c4ef6e38d81a9a6afb92eda07fa4c480b77fbf.tar.gz
traceback formatting improved
Diffstat (limited to 'pysnmp/smi/builder.py')
-rw-r--r--pysnmp/smi/builder.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/pysnmp/smi/builder.py b/pysnmp/smi/builder.py
index 84588662..214d7232 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