mirror of
https://github.com/python/cpython.git
synced 2025-10-19 16:03:42 +00:00
gh-138192: Fix Context initialization so that all subinterpreters are assigned the MISSING value. (gh-138503)
--------- Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This commit is contained in:
parent
9d6b94afe7
commit
f070f54c5f
3 changed files with 13 additions and 4 deletions
|
@ -1360,11 +1360,8 @@ get_token_missing(void)
|
|||
PyStatus
|
||||
_PyContext_Init(PyInterpreterState *interp)
|
||||
{
|
||||
if (!_Py_IsMainInterpreter(interp)) {
|
||||
return _PyStatus_OK();
|
||||
}
|
||||
|
||||
PyObject *missing = get_token_missing();
|
||||
assert(PyUnstable_IsImmortal(missing));
|
||||
if (PyDict_SetItemString(
|
||||
_PyType_GetDict(&PyContextToken_Type), "MISSING", missing))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue