diff options
Diffstat (limited to 'Python/modsupport.c')
| -rw-r--r-- | Python/modsupport.c | 5 | 
1 files changed, 3 insertions, 2 deletions
| diff --git a/Python/modsupport.c b/Python/modsupport.c index 6ee48f3..8bdec8b 100644 --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -34,8 +34,9 @@ Py_InitModule4(const char *name, PyMethodDef *methods, const char *doc,  {      PyObject *m, *d, *v, *n;      PyMethodDef *ml; -    if (!Py_IsInitialized()) -        Py_FatalError("Interpreter not initialized (version mismatch?)"); +    PyInterpreterState *interp = PyThreadState_Get()->interp; +    if (interp->modules == NULL) +        Py_FatalError("Python import machinery not initialized");      if (module_api_version != PYTHON_API_VERSION) {          char message[512];          PyOS_snprintf(message, sizeof(message), | 
