aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/pylifecycle.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r--Python/pylifecycle.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 484583e1c79..934614e73b5 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -790,6 +790,26 @@ pycore_init_builtins(PyThreadState *tstate)
}
interp->callable_cache.len = len;
+ PyObject *all = PyDict_GetItemWithError(builtins_dict, &_Py_ID(all));
+ if (!all) {
+ goto error;
+ }
+
+ PyObject *any = PyDict_GetItemWithError(builtins_dict, &_Py_ID(any));
+ if (!any) {
+ goto error;
+ }
+
+ interp->common_consts[CONSTANT_ASSERTIONERROR] = PyExc_AssertionError;
+ interp->common_consts[CONSTANT_NOTIMPLEMENTEDERROR] = PyExc_NotImplementedError;
+ interp->common_consts[CONSTANT_BUILTIN_TUPLE] = (PyObject*)&PyTuple_Type;
+ interp->common_consts[CONSTANT_BUILTIN_ALL] = all;
+ interp->common_consts[CONSTANT_BUILTIN_ANY] = any;
+
+ for (int i=0; i < NUM_COMMON_CONSTANTS; i++) {
+ assert(interp->common_consts[i] != NULL);
+ }
+
PyObject *list_append = _PyType_Lookup(&PyList_Type, &_Py_ID(append));
if (list_append == NULL) {
goto error;