[pypy-svn] r73119 - pypy/branch/cpython-extension/pypy/module/cpyext
xoraxax at codespeak.net
xoraxax at codespeak.net
Mon Mar 29 20:14:18 CEST 2010
Author: xoraxax
Date: Mon Mar 29 20:14:17 2010
New Revision: 73119
Modified:
pypy/branch/cpython-extension/pypy/module/cpyext/api.py
Log:
(amaury) some changes by amaury to rpythonify code.
Modified: pypy/branch/cpython-extension/pypy/module/cpyext/api.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/api.py (original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/api.py Mon Mar 29 20:14:17 2010
@@ -392,12 +392,14 @@
def make_wrapper(space, callable):
names = callable.api_func.argnames
argtypes_enum_ui = unrolling_iterable(enumerate(zip(callable.api_func.argtypes,
- names, [name.startswith("w_") for name in names])))
+ [name.startswith("w_") for name in names])))
+
+ @specialize.ll()
def wrapper(*args):
boxed_args = ()
if DEBUG_WRAPPER:
print >>sys.stderr, callable,
- for i, (typ, argname, is_wrapped) in argtypes_enum_ui:
+ for i, (typ, is_wrapped) in argtypes_enum_ui:
arg = args[i]
if (typ is PyObject and
is_wrapped):
@@ -655,7 +657,9 @@
result = func(*boxed_args)
try:
if RESULT_TYPE is PyObject:
- if isinstance(result, W_Root):
+ if result is None:
+ ret = result
+ elif isinstance(result, W_Root):
ret = result
else:
ret = from_ref(space, result)
More information about the Pypy-commit
mailing list