Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation under Python 3.9+ #610

Merged
merged 2 commits into from
Aug 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion asyncpg/protocol/record/recordobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

#include "recordobj.h"

#ifdef _PyObject_GC_IS_TRACKED
# define _ApgObject_GC_IS_TRACKED _PyObject_GC_IS_TRACKED
#else
# define _ApgObject_GC_IS_TRACKED PyObject_GC_IsTracked
#endif

static PyObject * record_iter(PyObject *);
static PyObject * record_new_items_iter(PyObject *);
Expand Down Expand Up @@ -57,7 +62,7 @@ ApgRecord_New(PyTypeObject *type, PyObject *desc, Py_ssize_t size)
return PyErr_NoMemory();
}
o = (ApgRecordObject *)type->tp_alloc(type, size);
if (!_PyObject_GC_IS_TRACKED(o)) {
if (!_ApgObject_GC_IS_TRACKED(o)) {
PyErr_SetString(
PyExc_TypeError,
"record subclass is not tracked by GC"
Expand Down