Skip to content

Commit 99c34ca

Browse files
committed
keep ref to iterable until after 'goto error'
1 parent 3ba9aae commit 99c34ca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Python/bytecodes.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2058,10 +2058,10 @@ dummy_func(
20582058
else {
20592059
/* `iterable` is not a generator. */
20602060
iter = PyObject_GetIter(iterable);
2061-
Py_DECREF(iterable);
20622061
if (iter == NULL) {
20632062
goto error;
20642063
}
2064+
Py_DECREF(iterable);
20652065
}
20662066
PREDICT(LOAD_CONST);
20672067
}

Python/generated_cases.c.h

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)