Kaydet (Commit) b45b7b21 authored tarafından 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.
üst b25d09a1
This diff is collapsed.
...@@ -11,6 +11,9 @@ Release date: TBA ...@@ -11,6 +11,9 @@ Release date: TBA
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.
...@@ -333,6 +336,8 @@ Documentation ...@@ -333,6 +336,8 @@ Documentation
Tests Tests
----- -----
- Issue #25449: Added tests for OrderedDict subclasses.
- Issue #25099: Make test_compileall not fail when an entry on sys.path cannot - Issue #25099: Make test_compileall not fail when an entry on sys.path cannot
be written to (commonly seen in administrative installs on Windows). be written to (commonly seen in administrative installs on Windows).
......
...@@ -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