bpo-40429: PyFrame_GetCode() result cannot be NULL (GH-19772)

Add frame_nslots() to factorize duplicate code.
This commit is contained in:
Victor Stinner 2020-04-29 00:56:58 +02:00 committed by GitHub
parent 521c8d6806
commit 6d86a2331e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 45 additions and 48 deletions

View file

@ -8040,11 +8040,6 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds)
return -1;
}
co = PyFrame_GetCode(f);
if (co == NULL) {
PyErr_SetString(PyExc_RuntimeError,
"super(): no code object");
return -1;
}
if (co->co_argcount == 0) {
PyErr_SetString(PyExc_RuntimeError,
"super(): no arguments");