Skip to content

Commit 9e8448a

Browse files
committed
Fix compilation under Python 3.9+
Python 3.9 moved a bunch of GC-related symbols around, including `_PyObject_GC_IS_TRACKED` which is used in `recordobj.c`. Fixes: #609
1 parent db4f1a6 commit 9e8448a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

asyncpg/protocol/record/recordobj.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ ApgRecord_New(PyTypeObject *type, PyObject *desc, Py_ssize_t size)
5757
return PyErr_NoMemory();
5858
}
5959
o = (ApgRecordObject *)type->tp_alloc(type, size);
60+
#ifdef _PyObject_GC_IS_TRACKED
6061
if (!_PyObject_GC_IS_TRACKED(o)) {
62+
#else
63+
if (!PyObject_GC_IsTracked(o)) {
64+
#endif
6165
PyErr_SetString(
6266
PyExc_TypeError,
6367
"record subclass is not tracked by GC"

0 commit comments

Comments
 (0)