gh-101967: add a missing error check (GH-101968)

(cherry picked from commit 89413bbccb)

Co-authored-by: Eclips4 <80244920+Eclips4@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2023-02-17 17:13:33 -08:00 committed by GitHub
parent 3c1b495cac
commit 92050e8767
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -4718,7 +4718,9 @@ positional_only_passed_as_keyword(PyThreadState *tstate, PyCodeObject *co,
{
int posonly_conflicts = 0;
PyObject* posonly_names = PyList_New(0);
if (posonly_names == NULL) {
goto fail;
}
for(int k=0; k < co->co_posonlyargcount; k++){
PyObject* posonly_name = PyTuple_GET_ITEM(co->co_varnames, k);