diff --git a/Python/import.c b/Python/import.c index f3aa9d43979..3bac5b8e41f 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1047,7 +1047,7 @@ _imp_create_builtin(PyObject *module, PyObject *spec) mod = _PyImport_FindExtensionObject(name, name); if (mod || PyErr_Occurred()) { Py_DECREF(name); - Py_INCREF(mod); + Py_XINCREF(mod); return mod; }