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

Appearance settings

Commit c05d726

Browse filesBrowse files
authored
Fix compilation under Python 3.9+ (#610)
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 c05d726
Copy full SHA for c05d726

File tree

Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed

‎asyncpg/protocol/record/recordobj.c

Copy file name to clipboardExpand all lines: asyncpg/protocol/record/recordobj.c
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
#include "recordobj.h"
1010

11+
#ifdef _PyObject_GC_IS_TRACKED
12+
# define _ApgObject_GC_IS_TRACKED _PyObject_GC_IS_TRACKED
13+
#else
14+
# define _ApgObject_GC_IS_TRACKED PyObject_GC_IsTracked
15+
#endif
1116

1217
static PyObject * record_iter(PyObject *);
1318
static PyObject * record_new_items_iter(PyObject *);
@@ -57,7 +62,7 @@ ApgRecord_New(PyTypeObject *type, PyObject *desc, Py_ssize_t size)
5762
return PyErr_NoMemory();
5863
}
5964
o = (ApgRecordObject *)type->tp_alloc(type, size);
60-
if (!_PyObject_GC_IS_TRACKED(o)) {
65+
if (!_ApgObject_GC_IS_TRACKED(o)) {
6166
PyErr_SetString(
6267
PyExc_TypeError,
6368
"record subclass is not tracked by GC"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.