[pypy-svn] pypy improve-unwrap_spec: update the _ffi module
amauryfa
commits-noreply at bitbucket.org
Wed Feb 16 19:19:15 CET 2011
Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: improve-unwrap_spec
Changeset: r42053:6394db00ef4d
Date: 2011-02-16 11:24 +0100
http://bitbucket.org/pypy/pypy/changeset/6394db00ef4d/
Log: update the _ffi module
diff --git a/pypy/module/_ffi/interp_ffi.py b/pypy/module/_ffi/interp_ffi.py
--- a/pypy/module/_ffi/interp_ffi.py
+++ b/pypy/module/_ffi/interp_ffi.py
@@ -1,6 +1,5 @@
import sys
-from pypy.interpreter.baseobjspace import W_Root, ObjSpace, Wrappable, \
- Arguments
+from pypy.interpreter.baseobjspace import Wrappable, Arguments
from pypy.interpreter.error import OperationError, wrap_oserror, \
operationerrfmt
from pypy.interpreter.gateway import interp2app, NoneNotWrapped, unwrap_spec
@@ -18,7 +17,6 @@
self.name = name
self.ffitype = ffitype
- @unwrap_spec('self', ObjSpace)
def str(self, space):
return space.wrap('<ffi type %s>' % self.name)
@@ -83,7 +81,7 @@
assert False, "Argument kind '%s' not supported" % kind
return argchain
- @unwrap_spec('self', ObjSpace, 'args_w')
+ @unwrap_spec(args_w='args_w')
def call(self, space, args_w):
self = jit.hint(self, promote=True)
argchain = self.build_argchain(space, self.func.argtypes, args_w)
@@ -152,7 +150,6 @@
space.wrap('Unsupported restype'))
return space.wrap(intres)
- @unwrap_spec('self', ObjSpace)
def getaddr(self, space):
"""
Return the physical address in memory of the function
@@ -187,7 +184,7 @@
raise OperationError(space.w_TypeError, space.wrap(msg))
return res
- @unwrap_spec('self', ObjSpace, str, W_Root, W_Root)
+ @unwrap_spec(name=str)
def getfunc(self, space, name, w_argtypes, w_restype):
argtypes = [self.ffitype(w_argtype) for w_argtype in
space.listview(w_argtypes)]
@@ -196,7 +193,7 @@
return W_FuncPtr(func)
- at unwrap_spec(ObjSpace, W_Root, str)
+ at unwrap_spec(name=str)
def descr_new_cdll(space, w_type, name):
return space.wrap(W_CDLL(space, name))
More information about the Pypy-commit
mailing list