[pypy-svn] r79054 - pypy/branch/fast-forward/pypy/rlib

afa at codespeak.net afa at codespeak.net
Sat Nov 13 16:34:21 CET 2010


Author: afa
Date: Sat Nov 13 16:34:19 2010
New Revision: 79054

Modified:
   pypy/branch/fast-forward/pypy/rlib/clibffi.py
Log:
translate.py *segfaulted* in node.py
where trying to render the CDLL.__del__ function.

This seems to be related to the VOIDP prebuilt constant, avoid it.


Modified: pypy/branch/fast-forward/pypy/rlib/clibffi.py
==============================================================================
--- pypy/branch/fast-forward/pypy/rlib/clibffi.py	(original)
+++ pypy/branch/fast-forward/pypy/rlib/clibffi.py	Sat Nov 13 16:34:19 2010
@@ -583,11 +583,9 @@
         return dlsym(self.lib, name)
 
 class CDLL(RawCDLL):
-    _default = rffi.cast(DLLHANDLE, -1)
-
     def __init__(self, libname):
         """Load the library, or raises DLOpenError."""
-        RawCDLL.__init__(self, self._default)
+        RawCDLL.__init__(self, rffi.cast(DLLHANDLE, -1))
         ll_libname = rffi.str2charp(libname)
         try:
             self.lib = dlopen(ll_libname)
@@ -595,7 +593,7 @@
             lltype.free(ll_libname, flavor='raw')
 
     def __del__(self):
-        if self.lib != self._default:
+        if self.lib != rffi.cast(DLLHANDLE, -1):
             dlclose(self.lib)
-            self.lib = self._default
+            self.lib = rffi.cast(DLLHANDLE, -1)
 



More information about the Pypy-commit mailing list