File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -674,6 +674,16 @@ pycore_create_interpreter(_PyRuntimeState *runtime,
674
674
return status ;
675
675
}
676
676
677
+ // Ideally we would call this in _PyInterpreterState_New(), but it
678
+ // requires interp->feature_flags to be correctly set already.
679
+ // That mwans we'd have to compute the feature flags before
680
+ // creating the interpreter and passing them in there, which we
681
+ // should probably be doing anyway.
682
+ status = _PyObject_InitState (interp );
683
+ if (_PyStatus_EXCEPTION (status )) {
684
+ return status ;
685
+ }
686
+
677
687
// initialize the interp->obmalloc state. This must be done after
678
688
// the settings are loaded (so that feature_flags are set) but before
679
689
// any calls are made to obmalloc functions.
Original file line number Diff line number Diff line change @@ -629,10 +629,9 @@ init_interpreter(PyInterpreterState *interp,
629
629
assert (next != NULL || (interp == runtime -> interpreters .main ));
630
630
interp -> next = next ;
631
631
632
- PyStatus status = _PyObject_InitState (interp );
633
- if (_PyStatus_EXCEPTION (status )) {
634
- return status ;
635
- }
632
+ // We would call _PyObject_InitState() here, but it needs the
633
+ // interp->feature_flags to be correctly set already, which we don't
634
+ // currently do.
636
635
637
636
_PyEval_InitState (interp );
638
637
_PyGC_InitState (& interp -> gc );
You can’t perform that action at this time.
0 commit comments