Commit 161b6ff1 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.
parents a3a3d732 b45b7b21
This diff is collapsed.
......@@ -10,6 +10,9 @@ Release date: XXXX-XX-XX
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.
......@@ -298,6 +301,8 @@ Documentation
Tests
-----
- Issue #25449: Added tests for OrderedDict subclasses.
- Issue #25188: Add -P/--pgo to test.regrtest to suppress error output when
running the test suite for the purposes of a PGO build. Initial patch by
Alecsandru Patrascu.
......
......@@ -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