Detect alternate NS3 installations (_ns3 module instead of ns3)
authorClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Tue, 10 May 2011 08:53:02 +0000 (10:53 +0200)
committerClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Tue, 10 May 2011 08:53:02 +0000 (10:53 +0200)
test/lib/test_util.py

index 87e22c3..39fe983 100644 (file)
@@ -44,7 +44,11 @@ def ns3_usable():
         found = imp.find_module('ns3')
         module = imp.load_module('ns3', *found)
     except ImportError:
-        return False
+        try:
+            found = imp.find_module('_ns3')
+            module = imp.load_module('_ns3', *found)
+        except ImportError:
+            return False
     finally:
         if ns3_bindings_path():
             del sys.path[0]