summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pysnmp/smi/compiler.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/pysnmp/smi/compiler.py b/pysnmp/smi/compiler.py
index e8f31dc..4efb224 100644
--- a/pysnmp/smi/compiler.py
+++ b/pysnmp/smi/compiler.py
@@ -5,6 +5,16 @@
import os
import sys
+defaultSources = [ 'file:///usr/share/snmp/mibs' ]
+
+if sys.platform[:3] == 'win':
+ defaultDest = os.path.join(os.path.expanduser("~"),
+ 'PySNMP Configuration', 'mibs')
+else:
+ defaultDest = os.path.join(os.path.expanduser("~"), '.pysnmp', 'mibs')
+
+defaultBorrowers = []
+
try:
from pysmi.reader.url import getReadersFromUrls
from pysmi.searcher.pypackage import PyPackageSearcher
@@ -26,15 +36,6 @@ except ImportError:
raise error.SmiError('MIB compiler not available (pysmi not installed)')
else:
- defaultSources = [ 'file:///usr/share/snmp/mibs' ]
-
- if sys.platform[:3] == 'win':
- defaultDest = os.path.join(os.path.expanduser("~"),
- 'PySNMP Configuration', 'mibs')
- else:
- defaultDest = os.path.join(os.path.expanduser("~"), '.pysnmp', 'mibs')
-
- defaultBorrowers = []
def addMibCompiler(mibBuilder,
sources=defaultSources,