summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-09-02 03:04:38 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-09-02 03:04:38 (GMT)
commit6a42bd67d7dc251ea96784c77dfc130a8456a486 (patch)
tree0d5e9b6a3616fdbaa81403a15a385dbcf50b7b33 /Objects
parent9f16e44a479d9efdfd4315df93a9e83901ef96b5 (diff)
downloadcpython-6a42bd67d7dc251ea96784c77dfc130a8456a486.zip
cpython-6a42bd67d7dc251ea96784c77dfc130a8456a486.tar.gz
cpython-6a42bd67d7dc251ea96784c77dfc130a8456a486.tar.bz2
Make super() internal errors RuntimeError instead of SystemError (closes #15839)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index a357ced..bc01b0d 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -6497,18 +6497,18 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds)
PyCodeObject *co = f->f_code;
Py_ssize_t i, n;
if (co == NULL) {
- PyErr_SetString(PyExc_SystemError,
+ PyErr_SetString(PyExc_RuntimeError,
"super(): no code object");
return -1;
}
if (co->co_argcount == 0) {
- PyErr_SetString(PyExc_SystemError,
+ PyErr_SetString(PyExc_RuntimeError,
"super(): no arguments");
return -1;
}
obj = f->f_localsplus[0];
if (obj == NULL) {
- PyErr_SetString(PyExc_SystemError,
+ PyErr_SetString(PyExc_RuntimeError,
"super(): arg[0] deleted");
return -1;
}
@@ -6527,18 +6527,18 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds)
PyTuple_GET_SIZE(co->co_cellvars) + i;
PyObject *cell = f->f_localsplus[index];
if (cell == NULL || !PyCell_Check(cell)) {
- PyErr_SetString(PyExc_SystemError,
+ PyErr_SetString(PyExc_RuntimeError,
"super(): bad __class__ cell");
return -1;
}
type = (PyTypeObject *) PyCell_GET(cell);
if (type == NULL) {
- PyErr_SetString(PyExc_SystemError,
+ PyErr_SetString(PyExc_RuntimeError,
"super(): empty __class__ cell");
return -1;
}
if (!PyType_Check(type)) {
- PyErr_Format(PyExc_SystemError,
+ PyErr_Format(PyExc_RuntimeError,
"super(): __class__ is not a type (%s)",
Py_TYPE(type)->tp_name);
return -1;
@@ -6547,7 +6547,7 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds)
}
}
if (type == NULL) {
- PyErr_SetString(PyExc_SystemError,
+ PyErr_SetString(PyExc_RuntimeError,
"super(): __class__ cell not found");
return -1;
}