[pypy-svn] r72769 - pypy/branch/cpython-extension/pypy/module/cpyext
afa at codespeak.net
afa at codespeak.net
Wed Mar 24 23:11:09 CET 2010
Author: afa
Date: Wed Mar 24 23:11:07 2010
New Revision: 72769
Modified:
pypy/branch/cpython-extension/pypy/module/cpyext/api.py
Log:
compatibility with CPython 2.4
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 Wed Mar 24 23:11:07 2010
@@ -94,15 +94,16 @@
arg = from_ref(space, arg)
newargs.append(arg)
try:
- return func(space, *newargs)
- except OperationError, e:
- if not hasattr(api_function, "error_value"):
- raise
- state = space.fromcache(State)
- e.normalize_exception(space)
- state.exc_type = e.w_type
- state.exc_value = e.get_w_value(space)
- return api_function.error_value
+ try:
+ return func(space, *newargs)
+ except OperationError, e:
+ if not hasattr(api_function, "error_value"):
+ raise
+ state = space.fromcache(State)
+ e.normalize_exception(space)
+ state.exc_type = e.w_type
+ state.exc_value = e.get_w_value(space)
+ return api_function.error_value
finally:
from pypy.module.cpyext.macros import Py_DECREF
for arg in to_decref:
More information about the Pypy-commit
mailing list