Update of /cvsroot/pywin32/pywin32/win32/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2508
Modified Files:
pywintypes.py
Log Message:
Work when running under Linux via the mainwin toolkit
Index: pywintypes.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Lib/pywintypes.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** pywintypes.py 5 Feb 2004 23:41:59 -0000 1.8
--- pywintypes.py 30 Mar 2004 04:25:11 -0000 1.9
***************
*** 8,11 ****
--- 8,25 ----
# there, as that way we can avoid the win32api import
import imp, sys, os
+ if not sys.platform.startswith("win32"):
+ # These extensions can be built on Linux via the 'mainwin' toolkit.
+ # Look for a native 'lib{modname}.so'
+ for ext, mode, ext_type in imp.get_suffixes():
+ if ext_type==imp.C_EXTENSION:
+ for path in sys.path:
+ look = os.path.join(path, "lib" + modname + ext)
+ if os.path.isfile(look):
+ mod = imp.load_module(modname, None, look,
+ (ext, mode, ext_type))
+ # and fill our namespace with it.
+ globs.update(mod.__dict__)
+ return
+ raise ImportError, "No dynamic module " + modname
# See if this is a debug build.
for suffix_item in imp.get_suffixes():
|