We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1663bfc commit 8ed0d76Copy full SHA for 8ed0d76
Objects/moduleobject.c
@@ -40,14 +40,16 @@ _PyModule_IsExtension(PyObject *obj)
40
PyObject*
41
PyModuleDef_Init(PyModuleDef* def)
42
{
43
+#define last_index _PyRuntime.imports.last_module_index
44
assert(PyModuleDef_Type.tp_flags & Py_TPFLAGS_READY);
45
if (def->m_base.m_index == 0) {
- _PyRuntime.imports.last_module_index++;
46
+ last_index++;
47
Py_SET_REFCNT(def, 1);
48
Py_SET_TYPE(def, &PyModuleDef_Type);
- def->m_base.m_index = _PyRuntime.imports.last_module_index;
49
+ def->m_base.m_index = last_index;
50
}
51
return (PyObject*)def;
52
+#undef last_index
53
54
55
static int
0 commit comments