Skip to content

Commit

Permalink
Set enable_gil properly when PYTHON_GIL=1
Browse files Browse the repository at this point in the history
  • Loading branch information
swtaarrs committed Mar 5, 2024
1 parent a53ed2e commit e0b8484
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Python/initconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e0b8484

Please sign in to comment.