mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
[3.12] gh-109894: Fix initialization of static MemoryError in subinterpreter (gh-110911) (gh-111238)
Fixes GH-109894
* set `interp.static_objects.last_resort_memory_error.args` to empty tuple to avoid crash on `PyErr_Display()` call
* allow `_PyExc_InitGlobalObjects()` to be called on subinterpreter init
---------
(cherry picked from commit 47d3e2ed93)
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
This commit is contained in:
parent
1e1a30f9f4
commit
0aceac557d
4 changed files with 16 additions and 4 deletions
|
|
@ -119,6 +119,7 @@ extern PyTypeObject _PyExc_MemoryError;
|
|||
}, \
|
||||
.last_resort_memory_error = { \
|
||||
_PyObject_HEAD_INIT(&_PyExc_MemoryError) \
|
||||
.args = (PyObject*)&_Py_SINGLETON(tuple_empty) \
|
||||
}, \
|
||||
}, \
|
||||
}, \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue