mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
Issue #27587: Merge from 3.5
This commit is contained in:
commit
c98afb7a26
2 changed files with 8 additions and 2 deletions
|
@ -285,14 +285,16 @@ int
|
|||
_PyState_AddModule(PyObject* module, struct PyModuleDef* def)
|
||||
{
|
||||
PyInterpreterState *state;
|
||||
if (!def) {
|
||||
assert(PyErr_Occurred());
|
||||
return -1;
|
||||
}
|
||||
if (def->m_slots) {
|
||||
PyErr_SetString(PyExc_SystemError,
|
||||
"PyState_AddModule called on module with slots");
|
||||
return -1;
|
||||
}
|
||||
state = GET_INTERP_STATE();
|
||||
if (!def)
|
||||
return -1;
|
||||
if (!state->modules_by_index) {
|
||||
state->modules_by_index = PyList_New(0);
|
||||
if (!state->modules_by_index)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue