aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Include/internal/pycore_runtime_init.h
diff options
context:
space:
mode:
authorRadislav Chugunov <52372310+chgnrdv@users.noreply.github.com>2023-10-24 02:06:59 +0300
committerGitHub <noreply@github.com>2023-10-23 17:06:59 -0600
commit47d3e2ed930a9f3d228aed4f62133737dae74cf7 (patch)
tree3d2097e5361f2185add54f89d9a96ab14978861b /Include/internal/pycore_runtime_init.h
parent96cbd1e1db3447a33e5cc5cc2886ce79b61cc6eb (diff)
downloadcpython-47d3e2ed930a9f3d228aed4f62133737dae74cf7.tar.gz
cpython-47d3e2ed930a9f3d228aed4f62133737dae74cf7.zip
gh-109894: Fix initialization of static `MemoryError` in subinterpreter (gh-110911)
Fixes #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 --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Diffstat (limited to 'Include/internal/pycore_runtime_init.h')
-rw-r--r--Include/internal/pycore_runtime_init.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Include/internal/pycore_runtime_init.h b/Include/internal/pycore_runtime_init.h
index 574a3c1a9db..4a48907d9ee 100644
--- a/Include/internal/pycore_runtime_init.h
+++ b/Include/internal/pycore_runtime_init.h
@@ -177,6 +177,7 @@ extern PyTypeObject _PyExc_MemoryError;
}, \
.last_resort_memory_error = { \
_PyObject_HEAD_INIT(&_PyExc_MemoryError) \
+ .args = (PyObject*)&_Py_SINGLETON(tuple_empty) \
}, \
}, \
}, \