Skip to content

Commit 1617961

Browse files
Reapply "remove unnecessary mem leak handling in unary and wrap method"
This reverts commit 266c2e7.
1 parent a6baac2 commit 1617961

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

Objects/weakrefobject.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,7 @@ _proxy_unwrap(PyObject **op, int *did_incref)
576576
static PyObject * \
577577
method(PyObject *proxy) { \
578578
int proxy_incref = 0; \
579-
if (!_proxy_unwrap(&proxy, &proxy_incref)) \
580-
return NULL; \
579+
UNWRAP(proxy); \
581580
PyObject* res = generic(proxy); \
582581
Py_DECREF(proxy); \
583582
return res; \
@@ -631,8 +630,7 @@ _proxy_unwrap(PyObject **op, int *did_incref)
631630
static PyObject * \
632631
method(PyObject *proxy, PyObject *Py_UNUSED(ignored)) { \
633632
int proxy_incref = 0; \
634-
if (!_proxy_unwrap(&proxy, &proxy_incref)) \
635-
return NULL; \
633+
UNWRAP(proxy); \
636634
PyObject* res = PyObject_CallMethodNoArgs(proxy, &_Py_ID(SPECIAL)); \
637635
Py_DECREF(proxy); \
638636
return res; \

0 commit comments

Comments
 (0)