We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
create_builtin()
sys
builtin
1 parent 656a64b commit e85b222Copy full SHA for e85b222
1 file changed
Python/import.c
@@ -2435,9 +2435,14 @@ create_builtin(
2435
p0 = lookup_inittab_initfunc(&info);
2436
if (p0 == NULL) {
2437
/* Cannot re-init internal module ("sys" or "builtins") */
2438
- assert(is_core_module(tstate->interp, info.name, info.path));
2439
- mod = import_add_module(tstate, info.name);
2440
- goto finally;
+ if (is_core_module(tstate->interp, info.name, info.path)) {
+ mod = import_add_module(tstate, info.name);
+ goto finally;
2441
+ }
2442
+ else {
2443
+ mod = Py_NewRef(Py_None);
2444
2445
2446
}
2447
2448
0 commit comments