Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd000b55

Browse files
committed
PyWeakref_GetRef() returns 1 on success
See upstream change:python/cpython@ee46cb6
1 parent6c49cf3 commitd000b55

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎pythoncapi_compat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ PyWeakref_GetRef(PyObject *ref, PyObject **pobj)
603603
return0;
604604
}
605605
*pobj =Py_NewRef(obj);
606-
return0;
606+
return(*pobj !=NULL);
607607
}
608608
#endif
609609

‎tests/test_pythoncapi_compat_cext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ test_weakref(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
710710

711711
// test PyWeakref_GetRef(), reference is alive
712712
PyObject*ref=Py_True;// marker to check that value was set
713-
assert(PyWeakref_GetRef(weakref,&ref)==0);
713+
assert(PyWeakref_GetRef(weakref,&ref)==1);
714714
assert(ref==obj);
715715
assert(Py_REFCNT(obj)== (refcnt+1));
716716
Py_DECREF(ref);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp