Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Call _PyObject_InitState() *after* computing the feature flags."
This reverts commit 8d52258.
  • Loading branch information
ericsnowcurrently committed Oct 21, 2024
commit 216dde2c3b1a0b57033e62837a92a333fa957fd3
10 changes: 0 additions & 10 deletions Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,16 +674,6 @@ pycore_create_interpreter(_PyRuntimeState *runtime,
return status;
}

// Ideally we would call this in _PyInterpreterState_New(), but it
// requires interp->feature_flags to be correctly set already.
// That mwans we'd have to compute the feature flags before
// creating the interpreter and passing them in there, which we
// should probably be doing anyway.
status = _PyObject_InitState(interp);
if (_PyStatus_EXCEPTION(status)) {
return status;
}

// initialize the interp->obmalloc state. This must be done after
// the settings are loaded (so that feature_flags are set) but before
// any calls are made to obmalloc functions.
Expand Down
7 changes: 4 additions & 3 deletions Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,10 @@ init_interpreter(PyInterpreterState *interp,
assert(next != NULL || (interp == runtime->interpreters.main));
interp->next = next;

// We would call _PyObject_InitState() here, but it needs the
// interp->feature_flags to be correctly set already, which we don't
// currently do.
PyStatus status = _PyObject_InitState(interp);
if (_PyStatus_EXCEPTION(status)) {
return status;
}

_PyEval_InitState(interp);
_PyGC_InitState(&interp->gc);
Expand Down