Core and Builtins
-----------------
+- Fix the builtin module initialization code to store the init function for
+ future reinitialization.
+
- Issue #13629: Renumber the tokens in token.h so that they match the indexes
into _PyParser_TokenNames.
for (p = PyImport_Inittab; p->name != NULL; p++) {
PyObject *mod;
+ PyModuleDef *def;
if (strcmp(name, p->name) == 0) {
if (p->initfunc == NULL) {
PyErr_Format(PyExc_ImportError,
mod = (*p->initfunc)();
if (mod == 0)
return -1;
+ /* Remember pointer to module init function. */
+ def = PyModule_GetDef(mod);
+ def->m_base.m_init = p->initfunc;
if (_PyImport_FixupBuiltin(mod, name) < 0)
return -1;
/* FixupExtension has put the module into sys.modules,