gh-117953: Cleanups For fix_up_extension() in import.c (gh-118192)

These are cleanups I've pulled out of gh-118116.  Mostly, this change moves code around to align with some future changes and to improve clarity a little.  There is one very small change in behavior: we now add the module to the per-interpreter caches after updating the global state, rather than before.
This commit is contained in:
Eric Snow 2024-04-24 09:55:48 -06:00 committed by GitHub
parent 8227883d1f
commit af3c1d817d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 163 additions and 97 deletions

View file

@ -777,7 +777,7 @@ pycore_init_builtins(PyThreadState *tstate)
}
PyObject *modules = _PyImport_GetModules(interp);
if (_PyImport_FixupBuiltin(bimod, "builtins", modules) < 0) {
if (_PyImport_FixupBuiltin(tstate, bimod, "builtins", modules) < 0) {
goto error;
}