diff --git a/Python/initconfig.c b/Python/initconfig.c index 693d9188fc3b92..62676e0bf3cf8b 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -1656,7 +1656,9 @@ config_read_env_vars(PyConfig *config) #ifdef Py_GIL_DISABLED if (strcmp(gil, "0") == 0) { config->enable_gil = _PyConfig_GIL_DISABLE; - } else if (strcmp(gil, "1") != 0) { + } else if (strcmp(gil, "1") == 0) { + config->enable_gil = _PyConfig_GIL_ENABLE; + } else { return _PyStatus_ERR("PYTHON_GIL must be \"0\" or \"1\""); } #else