Browse Source

Don't show libpandaexpress ImportError if importing panda3d.core failed

rdb 9 years ago
parent
commit
461b231a2e
1 changed files with 8 additions and 3 deletions
  1. 8 3
      direct/src/extensions_native/extension_native_helpers.py

+ 8 - 3
direct/src/extensions_native/extension_native_helpers.py

@@ -111,9 +111,14 @@ def Dtool_PreloadDLL(module):
 # new-style build, and if it fails we must be in an old-style build.
 try:
     from panda3d.core import *
-except ImportError:
-    Dtool_PreloadDLL("libpandaexpress")
-    from libpandaexpress import *
+except ImportError as ex:
+    # Maybe we're using an old-style libpandaexpress module?
+    try:
+        Dtool_PreloadDLL("libpandaexpress")
+        from libpandaexpress import *
+    except ImportError:
+        # Nope.  Re-raise the original ImportError.
+        raise ex
 
 def Dtool_ObjectToDict(cls, name, obj):
     cls.DtoolClassDict[name] = obj;