Update sys module to conform with the PEP, add matching C API

This commit is contained in:
Dino Viehland 2025-10-09 13:27:14 -07:00
parent fe526b4e54
commit 06b9110569
18 changed files with 260 additions and 177 deletions

View file

@ -1321,11 +1321,11 @@ init_interp_main(PyThreadState *tstate)
if (config->lazy_imports != -1) {
PyImport_LazyImportsMode lazy_mode;
if (config->lazy_imports == 1) {
lazy_mode = PyLazyImportsMode_ForcedOn;
lazy_mode = PyImport_LAZY_ALL;
} else {
lazy_mode = PyLazyImportsMode_ForcedOff;
lazy_mode = PyImport_LAZY_NONE;
}
if (PyImport_SetLazyImports(lazy_mode, NULL) < 0) {
if (PyImport_SetLazyImportsMode(lazy_mode) < 0) {
return _PyStatus_ERR("failed to set lazy imports mode");
}
}