Skip to content

Commit

Permalink
Replace obsolete, unsafe Py_TRASHCAN_SAFE_BEGIN/END
Browse files Browse the repository at this point in the history
Use Py_TRASHCAN_BEGIN/END instead.

https://bugs.python.org/issue44874

These are removed from the limited C API in Python 3.9, deprecated in
3.11, and removed in Python 3.13:

https://docs.python.org/3.13/whatsnew/3.13.html#id8
  • Loading branch information
musicinmybrain committed Jul 12, 2024
1 parent 1194a8a commit 2f7cbbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions asyncpg/protocol/record/recordobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ record_dealloc(ApgRecordObject *o)

Py_CLEAR(o->desc);

Py_TRASHCAN_SAFE_BEGIN(o)
Py_TRASHCAN_BEGIN(o, record_dealloc)
if (len > 0) {
i = len;
while (--i >= 0) {
Expand All @@ -117,7 +117,7 @@ record_dealloc(ApgRecordObject *o)
}
Py_TYPE(o)->tp_free((PyObject *)o);
done:
Py_TRASHCAN_SAFE_END(o)
Py_TRASHCAN_END
}


Expand Down

0 comments on commit 2f7cbbb

Please sign in to comment.