gh-132386: Fix a crash when passing a dict subclass to exec (GH-132412)

* Fix crash when passing a dict subclass to exec

* Add news entry
This commit is contained in:
Tomas R. 2025-04-11 23:05:03 +02:00 committed by GitHub
parent deda47d6e1
commit e6ef47ac22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 0 deletions

View file

@ -3312,6 +3312,8 @@ _PyEval_LoadGlobalStackRef(PyObject *globals, PyObject *builtins, PyObject *name
_PyEval_FormatExcCheckArg(
PyThreadState_GET(), PyExc_NameError,
NAME_ERROR_MSG, name);
*writeto = PyStackRef_NULL;
return;
}
}
*writeto = PyStackRef_FromPyObjectSteal(res);