From 6b1b945a77ea1b7855bd976b22c6a9e1dc946d75 Mon Sep 17 00:00:00 2001 From: Chris Brunner Date: Thu, 27 May 2010 23:54:00 +0000 Subject: [PATCH] Use Dtool_PreloadDLL instead of __import__ for dll's --- direct/src/ffi/genPyCode.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/direct/src/ffi/genPyCode.pp b/direct/src/ffi/genPyCode.pp index 5cd15a5e20..aa501ddf5a 100644 --- a/direct/src/ffi/genPyCode.pp +++ b/direct/src/ffi/genPyCode.pp @@ -66,6 +66,8 @@ import os import sys import glob +from direct.extensions_native.extension_native_helpers import Dtool_PreloadDLL + #if $[CTPROJS] # This script was generated while the user was using the ctattach # 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, # instrument it. try: - __import__(basename, globals(), locals()) + Dtool_PreloadDLL(basename) + # __import__(basename, globals(), locals()) isModule = 1 except: isModule = 0 @@ -197,7 +200,8 @@ for package in packages: # debug py library magin naming in windows.. basename = basename.replace('_d','') try: - __import__(basename, globals(), locals()) + Dtool_PreloadDLL(basename) + # __import__(basename, globals(), locals()) isModule = 1 except: isModule = 0