Commit 711e79a5 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #25449: Iterating OrderedDict with keys with unstable hash now raises

KeyError in C implementations as well as in Python implementation.

Added tests for OrderedDict subclasses.
parent e07ce464
This diff is collapsed.
......@@ -11,6 +11,9 @@ Release date: TBA
Core and Builtins
-----------------
- Issue #25449: Iterating OrderedDict with keys with unstable hash now raises
KeyError in C implementations as well as in Python implementation.
- Issue #25395: Fixed crash when highly nested OrderedDict structures were
garbage collected.
......@@ -333,6 +336,8 @@ Documentation
Tests
-----
- Issue #25449: Added tests for OrderedDict subclasses.
- Issue #25099: Make test_compileall not fail when an entry on sys.path cannot
be written to (commonly seen in administrative installs on Windows).
......
......@@ -1789,6 +1789,8 @@ odictiter_nextkey(odictiterobject *di)
/* Get the key. */
node = _odict_find_node(di->di_odict, di->di_current);
if (node == NULL) {
if (!PyErr_Occurred())
PyErr_SetObject(PyExc_KeyError, di->di_current);
/* Must have been deleted. */
Py_CLEAR(di->di_current);
return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment