diff options
author | 2016-03-30 20:40:02 +0300 | |
---|---|---|
committer | 2016-03-30 20:40:02 +0300 | |
commit | fbb1c5ee068d209e33f6e15ecb4821d5d8b107fa (patch) | |
tree | 4ae6657a598c5cfe5357f3106d956ed721d83e24 /Objects/iterobject.c | |
parent | Fix typo in xml.dom.pulldom.rst (diff) | |
download | cpython-fbb1c5ee068d209e33f6e15ecb4821d5d8b107fa.tar.gz cpython-fbb1c5ee068d209e33f6e15ecb4821d5d8b107fa.tar.bz2 cpython-fbb1c5ee068d209e33f6e15ecb4821d5d8b107fa.zip |
Issue #26494: Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
Diffstat (limited to 'Objects/iterobject.c')
-rw-r--r-- | Objects/iterobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/iterobject.c b/Objects/iterobject.c index 2fb0c8832a9..ab29ff81a95 100644 --- a/Objects/iterobject.c +++ b/Objects/iterobject.c @@ -69,8 +69,8 @@ iter_iternext(PyObject *iterator) PyErr_ExceptionMatches(PyExc_StopIteration)) { PyErr_Clear(); - Py_DECREF(seq); it->it_seq = NULL; + Py_DECREF(seq); } return NULL; } |