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

@ -784,10 +784,6 @@ is_internal_frame(PyFrameObject *frame)
}
PyCodeObject *code = PyFrame_GetCode(frame);
if (code == NULL) {
return 0;
}
PyObject *filename = code->co_filename;
if (filename == NULL) {
return 0;