[pypy-commit] pypy cpyext-avoid-roundtrip: oops, fixes
arigo
pypy.commits at gmail.com
Tue Oct 10 05:30:38 EDT 2017
Author: Armin Rigo <arigo at tunes.org>
Branch: cpyext-avoid-roundtrip
Changeset: r92700:3c9c5746d625
Date: 2017-10-10 11:29 +0200
http://bitbucket.org/pypy/pypy/changeset/3c9c5746d625/
Log: oops, fixes
diff --git a/pypy/module/cpyext/pyerrors.py b/pypy/module/cpyext/pyerrors.py
--- a/pypy/module/cpyext/pyerrors.py
+++ b/pypy/module/cpyext/pyerrors.py
@@ -6,7 +6,7 @@
from pypy.module.cpyext.api import cpython_api, CANNOT_FAIL, CONST_STRING
from pypy.module.exceptions.interp_exceptions import W_RuntimeWarning
from pypy.module.cpyext.pyobject import (
- PyObject, PyObjectP, make_ref, from_ref, decref)
+ PyObject, PyObjectP, make_ref, from_ref, decref, get_w_obj_and_decref)
from pypy.module.cpyext.state import State
from pypy.module.cpyext.import_ import PyImport_Import
from rpython.rlib import rposix, jit
@@ -80,9 +80,10 @@
error indicator temporarily; use PyErr_Fetch() to save the current
exception state."""
state = space.fromcache(State)
- w_type = get_w_obj_and_decref(py_type)
- w_value = get_w_obj_and_decref(py_value)
- w_traceback = get_w_obj_and_decref(py_traceback) #XXX do something with that
+ w_type = get_w_obj_and_decref(space, py_type)
+ w_value = get_w_obj_and_decref(space, py_value)
+ w_traceback = get_w_obj_and_decref(space, py_traceback)
+ # XXX do something with w_traceback
if w_type is None:
state.clear_exception()
return
@@ -406,9 +407,9 @@
restore the exception state temporarily. Use
:c:func:`PyErr_GetExcInfo` to read the exception state.
"""
- w_type = get_w_obj_and_decref(py_type)
- w_value = get_w_obj_and_decref(py_value)
- w_traceback = get_w_obj_and_decref(py_traceback)
+ w_type = get_w_obj_and_decref(space, py_type)
+ w_value = get_w_obj_and_decref(space, py_value)
+ w_traceback = get_w_obj_and_decref(space, py_traceback)
if w_value is None or space.is_w(w_value, space.w_None):
operror = None
else:
diff --git a/pypy/module/cpyext/test/test_memoryobject.py b/pypy/module/cpyext/test/test_memoryobject.py
--- a/pypy/module/cpyext/test/test_memoryobject.py
+++ b/pypy/module/cpyext/test/test_memoryobject.py
@@ -32,7 +32,7 @@
assert space.eq_w(space.getattr(w_mv, w_f),
space.getattr(w_memoryview, w_f))
decref(space, ref)
- decref(space, w_memoryview)
+ decref(space, c_memoryview)
class AppTestPyBuffer_FillInfo(AppTestCpythonExtensionBase):
def test_fillWithObject(self):
More information about the pypy-commit
mailing list