瀏覽代碼

Use Dtool_PreloadDLL instead of __import__ for dll's

Chris Brunner 15 年之前
父節點
當前提交
6b1b945a77
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      direct/src/ffi/genPyCode.pp

+ 6 - 2
direct/src/ffi/genPyCode.pp

@@ -66,6 +66,8 @@ import os
 import sys
 import sys
 import glob
 import glob
 
 
+from direct.extensions_native.extension_native_helpers import Dtool_PreloadDLL
+
 #if $[CTPROJS]
 #if $[CTPROJS]
 # This script was generated while the user was using the ctattach
 # This script was generated while the user was using the ctattach
 # tools.  That had better still be the case.
 # tools.  That had better still be the case.
@@ -185,7 +187,8 @@ for package in packages:
                     # Try to import the library.  If we can import it,
                     # Try to import the library.  If we can import it,
                     # instrument it.
                     # instrument it.
                     try:
                     try:
-                        __import__(basename, globals(), locals())
+                        Dtool_PreloadDLL(basename)
+                        # __import__(basename, globals(), locals())
                         isModule = 1
                         isModule = 1
                     except:
                     except:
                         isModule = 0
                         isModule = 0
@@ -197,7 +200,8 @@ for package in packages:
                         # debug py library magin naming in windows..
                         # debug py library magin naming in windows..
                         basename = basename.replace('_d','')                   
                         basename = basename.replace('_d','')                   
                         try:
                         try:
-                            __import__(basename, globals(), locals())
+                            Dtool_PreloadDLL(basename)
+                            # __import__(basename, globals(), locals())
                             isModule = 1
                             isModule = 1
                         except:
                         except:
                             isModule = 0                        
                             isModule = 0