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 ...@@ -10,6 +10,9 @@ Release date: XXXX-XX-XX
Core and Builtins 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 - Issue #25395: Fixed crash when highly nested OrderedDict structures were
garbage collected. garbage collected.
...@@ -298,6 +301,8 @@ Documentation ...@@ -298,6 +301,8 @@ Documentation
Tests Tests
----- -----
- Issue #25449: Added tests for OrderedDict subclasses.
- Issue #25188: Add -P/--pgo to test.regrtest to suppress error output when - 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 running the test suite for the purposes of a PGO build. Initial patch by
Alecsandru Patrascu. Alecsandru Patrascu.
......
...@@ -1789,6 +1789,8 @@ odictiter_nextkey(odictiterobject *di) ...@@ -1789,6 +1789,8 @@ odictiter_nextkey(odictiterobject *di)
/* Get the key. */ /* Get the key. */
node = _odict_find_node(di->di_odict, di->di_current); node = _odict_find_node(di->di_odict, di->di_current);
if (node == NULL) { if (node == NULL) {
if (!PyErr_Occurred())
PyErr_SetObject(PyExc_KeyError, di->di_current);
/* Must have been deleted. */ /* Must have been deleted. */
Py_CLEAR(di->di_current); Py_CLEAR(di->di_current);
return NULL; 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