diff --git a/asyncpg/protocol/record/recordobj.c b/asyncpg/protocol/record/recordobj.c index 180fc141..e3ba77a3 100644 --- a/asyncpg/protocol/record/recordobj.c +++ b/asyncpg/protocol/record/recordobj.c @@ -14,6 +14,21 @@ # define _ApgObject_GC_IS_TRACKED PyObject_GC_IsTracked #endif +#if PY_VERSION_HEX < 0x03070000 +static const char * _PyType_Name(PyTypeObject *type) +{ + assert(type->tp_name != NULL); + const char *s = strrchr(type->tp_name, '.'); + if (s == NULL) { + s = type->tp_name; + } + else { + s++; + } + return s; +} +#endif + static PyObject * record_iter(PyObject *); static PyObject * record_new_items_iter(PyObject *);