Skip to content

Commit ddf4a6a

Browse files
remove unnecessary mem leak handling in unary and wrap method
1 parent bec9c76 commit ddf4a6a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Objects/weakrefobject.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,7 @@ _proxy_unwrap(PyObject **op, int *did_incref)
561561
static PyObject * \
562562
method(PyObject *proxy) { \
563563
int proxy_incref = 0; \
564-
if (!_proxy_unwrap(&proxy, &proxy_incref)) \
565-
return NULL; \
564+
UNWRAP(proxy); \
566565
PyObject* res = generic(proxy); \
567566
Py_DECREF(proxy); \
568567
return res; \
@@ -616,8 +615,7 @@ _proxy_unwrap(PyObject **op, int *did_incref)
616615
static PyObject * \
617616
method(PyObject *proxy, PyObject *Py_UNUSED(ignored)) { \
618617
int proxy_incref = 0; \
619-
if (!_proxy_unwrap(&proxy, &proxy_incref)) \
620-
return NULL; \
618+
UNWRAP(proxy); \
621619
PyObject* res = PyObject_CallMethodNoArgs(proxy, &_Py_ID(SPECIAL)); \
622620
Py_DECREF(proxy); \
623621
return res; \

0 commit comments

Comments
 (0)