File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ What's New in Python 3.2.3?
1010Core and Builtins
1111-----------------
1212
13+ - Fix the builtin module initialization code to store the init function for
14+ future reinitialization.
15+
1316- Issue #13629: Renumber the tokens in token.h so that they match the indexes
1417 into _PyParser_TokenNames.
1518
Original file line number Diff line number Diff line change @@ -2169,6 +2169,7 @@ init_builtin(char *name)
21692169
21702170 for (p = PyImport_Inittab ; p -> name != NULL ; p ++ ) {
21712171 PyObject * mod ;
2172+ PyModuleDef * def ;
21722173 if (strcmp (name , p -> name ) == 0 ) {
21732174 if (p -> initfunc == NULL ) {
21742175 PyErr_Format (PyExc_ImportError ,
@@ -2181,6 +2182,9 @@ init_builtin(char *name)
21812182 mod = (* p -> initfunc )();
21822183 if (mod == 0 )
21832184 return -1 ;
2185+ /* Remember pointer to module init function. */
2186+ def = PyModule_GetDef (mod );
2187+ def -> m_base .m_init = p -> initfunc ;
21842188 if (_PyImport_FixupBuiltin (mod , name ) < 0 )
21852189 return -1 ;
21862190 /* FixupExtension has put the module into sys.modules,
You can’t perform that action at this time.
0 commit comments