There was an error while loading. Please reload this page.
1 parent 37c9529 commit fece88dCopy full SHA for fece88d
1 file changed
Objects/weakrefobject.c
@@ -353,15 +353,10 @@ try_reuse_basic_ref(PyWeakReference *list, PyTypeObject *type,
353
cand = proxy;
354
}
355
356
-#ifdef Py_GIL_DISABLED
357
- if (cand != NULL && !_Py_TryIncref((PyObject *) cand)) {
358
- cand = NULL;
+ if (cand != NULL && _Py_TryIncref((PyObject *) cand)) {
+ return cand;
359
360
-#else
361
- Py_XINCREF(cand);
362
-#endif
363
-
364
- return cand;
+ return NULL;
365
366
367
static int
0 commit comments