[pypy-svn] r60759 - pypy/trunk/lib-python/modified-2.5.2/ctypes

arigo at codespeak.net arigo at codespeak.net
Fri Jan 2 17:09:40 CET 2009


Author: arigo
Date: Fri Jan  2 17:09:37 2009
New Revision: 60759

Modified:
   pypy/trunk/lib-python/modified-2.5.2/ctypes/__init__.py
Log:
Make general code instead of PyPy-specific only.


Modified: pypy/trunk/lib-python/modified-2.5.2/ctypes/__init__.py
==============================================================================
--- pypy/trunk/lib-python/modified-2.5.2/ctypes/__init__.py	(original)
+++ pypy/trunk/lib-python/modified-2.5.2/ctypes/__init__.py	Fri Jan  2 17:09:37 2009
@@ -433,7 +433,15 @@
 cdll = LibraryLoader(CDLL)
 pydll = LibraryLoader(PyDLL)
 
-pythonapi = None
+if _sys.subversion[0] == 'CPython':
+    if _os.name in ("nt", "ce"):
+        pythonapi = PyDLL("python dll", None, _sys.dllhandle)
+    elif _sys.platform == "cygwin":
+        pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])
+    else:
+        pythonapi = PyDLL(None)
+else:
+    pythonapi = None
 
 
 if _os.name in ("nt", "ce"):



More information about the Pypy-commit mailing list