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.3 Alpha 1?
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 @@ -2542,6 +2542,7 @@ init_builtin(PyObject *name)
25422542
25432543 for (p = PyImport_Inittab ; p -> name != NULL ; p ++ ) {
25442544 PyObject * mod ;
2545+ PyModuleDef * def ;
25452546 if (PyUnicode_CompareWithASCIIString (name , p -> name ) == 0 ) {
25462547 if (p -> initfunc == NULL ) {
25472548 PyErr_Format (PyExc_ImportError ,
@@ -2554,6 +2555,9 @@ init_builtin(PyObject *name)
25542555 mod = (* p -> initfunc )();
25552556 if (mod == 0 )
25562557 return -1 ;
2558+ /* Remember pointer to module init function. */
2559+ def = PyModule_GetDef (mod );
2560+ def -> m_base .m_init = p -> initfunc ;
25572561 if (_PyImport_FixupExtensionObject (mod , name , name ) < 0 )
25582562 return -1 ;
25592563 /* FixupExtension has put the module into sys.modules,
You can’t perform that action at this time.
0 commit comments