mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
PR #1638, for bpo-28411, causes problems in some (very) edge cases. Until that gets sorted out, we're reverting the merge. PR #3506, a fix on top of #1638, is also getting reverted.
This commit is contained in:
parent
13ad3b7a82
commit
93c92f7d1d
21 changed files with 154 additions and 308 deletions
|
@ -161,18 +161,12 @@ _add_methods_to_object(PyObject *module, PyObject *name, PyMethodDef *functions)
|
|||
|
||||
PyObject *
|
||||
PyModule_Create2(struct PyModuleDef* module, int module_api_version)
|
||||
{
|
||||
if (!_PyImport_IsInitialized(PyThreadState_GET()->interp))
|
||||
Py_FatalError("Python import machinery not initialized");
|
||||
return _PyModule_CreateInitialized(module, module_api_version);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
_PyModule_CreateInitialized(struct PyModuleDef* module, int module_api_version)
|
||||
{
|
||||
const char* name;
|
||||
PyModuleObject *m;
|
||||
|
||||
PyInterpreterState *interp = PyThreadState_Get()->interp;
|
||||
if (interp->modules == NULL)
|
||||
Py_FatalError("Python import machinery not initialized");
|
||||
if (!PyModuleDef_Init(module))
|
||||
return NULL;
|
||||
name = module->m_name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue