summaryrefslogtreecommitdiffstats
path: root/Python/modsupport.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/modsupport.c')
-rw-r--r--Python/modsupport.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/modsupport.c b/Python/modsupport.c
index 7569845..be229c9 100644
--- a/Python/modsupport.c
+++ b/Python/modsupport.c
@@ -3,6 +3,7 @@
#include "Python.h"
#include "pycore_abstract.h" // _PyIndex_Check()
+#include "pycore_object.h" // _PyType_IsReady()
#define FLAG_SIZE_T 1
typedef double va_double;
@@ -693,7 +694,7 @@ PyModule_AddStringConstant(PyObject *m, const char *name, const char *value)
int
PyModule_AddType(PyObject *module, PyTypeObject *type)
{
- if (PyType_Ready(type) < 0) {
+ if (!_PyType_IsReady(type) && PyType_Ready(type) < 0) {
return -1;
}