Author: Armin Rigo <ar...@tunes.org> Branch: cpyext-gc-support-2 Changeset: r82229:cba976d16588 Date: 2016-02-14 10:43 +0100 http://bitbucket.org/pypy/pypy/changeset/cba976d16588/
Log: fix weakrefobject diff --git a/pypy/module/cpyext/weakrefobject.py b/pypy/module/cpyext/weakrefobject.py --- a/pypy/module/cpyext/weakrefobject.py +++ b/pypy/module/cpyext/weakrefobject.py @@ -37,17 +37,19 @@ """ return PyWeakref_GET_OBJECT(space, w_ref) -@cpython_api([PyObject], PyObject) +@cpython_api([PyObject], PyObject, result_borrowed=True) def PyWeakref_GET_OBJECT(space, w_ref): """Similar to PyWeakref_GetObject(), but implemented as a macro that does no error checking. """ - return borrow_from(w_ref, space.call_function(w_ref)) + return space.call_function(w_ref) @cpython_api([PyObject], PyObject) def PyWeakref_LockObject(space, w_ref): """Return the referenced object from a weak reference. If the referent is no longer live, returns None. This function returns a new reference. + + (A PyPy extension that may not be useful any more: use + PyWeakref_GetObject() and Py_INCREF().) """ return space.call_function(w_ref) - _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit