[pypy-svn] r75491 - pypy/branch/fast-ctypes/pypy/module/jitffi
getxsick at codespeak.net
getxsick at codespeak.net
Tue Jun 22 04:16:58 CEST 2010
Author: getxsick
Date: Tue Jun 22 04:16:56 2010
New Revision: 75491
Modified:
pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py
Log:
rename W_Lib to W_LibHandler just to avoid conflicts between W_Lib and W_CDLL names
Modified: pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py
==============================================================================
--- pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py (original)
+++ pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py Tue Jun 22 04:16:56 2010
@@ -5,7 +5,7 @@
from pypy.interpreter.gateway import interp2app
from pypy.interpreter.typedef import TypeDef
-class W_Lib(Wrappable):
+class W_LibHandler(Wrappable):
def __init__(self, space, name):
try:
self.handler = rdynload.dlopen(name)
@@ -14,17 +14,19 @@
self.space = space
-def W_Lib___new__(space, w_type, name):
+def W_LibHandler___new__(space, w_type, name):
try:
return space.wrap(W_Lib(space, name))
except OSError, e:
raise wrap_oserror(space, e)
-W_Lib.typedef = TypeDef(
- 'Lib',
- __new__ = interp2app(W_Lib___new__, unwrap_spec=[ObjSpace,W_Root,str])
+W_LibHandler.typedef = TypeDef(
+ 'LibHandler',
+ __new__ = interp2app(W_LibHandler___new__, unwrap_spec=[ObjSpace,
+ W_Root, str])
)
+
class W_Get(Wrappable, rjitffi._Get):
def __init__(self, space, cpu, lib, func, args_type, res_type='void'):
self.space = space
@@ -58,12 +60,12 @@
call = interp2app(W_Get.call_w, unwrap_spec=['self', ObjSpace, W_Root])
)
+
class W_CDLL(Wrappable, rjitffi.CDLL):
def __init__(self, space, name):
self.space = space
- rjitffi.CDLL.__init__(self, name)
- # XXX we load a library twice (in super-class and below)
- self.lib_w = W_Lib(self.space, name)
+ rjitffi.CDLL.__init__(self, name, load=False)
+ self.lib_w = W_LibHandler(self.space, name)
def get_w(self, space, func, w_args_type, res_type='void'):
args_type_w = [ space.str_w(w_x)
More information about the Pypy-commit
mailing list