Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
colesbury and vstinner authored Dec 17, 2024
1 parent 630f668 commit 8f11f7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Doc/c-api/weakref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ as much as it can.
.. c:function:: int PyWeakref_IsDead(PyObject *ref)
Test if a weak reference, *ref*, is dead. Returns 1 if the reference is
Test if the weak reference *ref* is dead. Returns 1 if the reference is
dead, 0 if it is alive, and -1 with an error set if *ref* is not a weak
reference object.
Expand Down
2 changes: 1 addition & 1 deletion Objects/weakrefobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ PyWeakref_IsDead(PyObject *ref)
return -1;
}
if (!PyWeakref_Check(ref)) {
PyErr_SetString(PyExc_TypeError, "expected a weakref");
PyErr_Format(PyExc_TypeError, "expected a weakref, got %T", ref);
return -1;
}
return _PyWeakref_IS_DEAD(ref);
Expand Down

0 comments on commit 8f11f7e

Please sign in to comment.