Kaydet (Commit) c76aa483 authored tarafından Raymond Hettinger's avatar Raymond Hettinger

merge

...@@ -158,6 +158,15 @@ class TestHeap: ...@@ -158,6 +158,15 @@ class TestHeap:
self.assertEqual(sorted(chain(*inputs)), list(self.module.merge(*inputs))) self.assertEqual(sorted(chain(*inputs)), list(self.module.merge(*inputs)))
self.assertEqual(list(self.module.merge()), []) self.assertEqual(list(self.module.merge()), [])
def test_merge_does_not_suppress_index_error(self):
# Issue 19018: Heapq.merge suppresses IndexError from user generator
def iterable():
s = list(range(10))
for i in range(20):
yield s[i] # IndexError when i > 10
with self.assertRaises(IndexError):
list(self.module.merge(iterable(), iterable()))
def test_merge_stability(self): def test_merge_stability(self):
class Int(int): class Int(int):
pass pass
......
...@@ -394,6 +394,7 @@ Nils Fischbeck ...@@ -394,6 +394,7 @@ Nils Fischbeck
Frederik Fix Frederik Fix
Matt Fleming Matt Fleming
Hernán Martínez Foffani Hernán Martínez Foffani
Artem Fokin
Arnaud Fontaine Arnaud Fontaine
Michael Foord Michael Foord
Amaury Forgeot d'Arc Amaury Forgeot d'Arc
......
...@@ -18,6 +18,9 @@ Library ...@@ -18,6 +18,9 @@ Library
- Issue #17324: Fix http.server's request handling case on trailing '/'. Patch - Issue #17324: Fix http.server's request handling case on trailing '/'. Patch
contributed by Vajrasky Kok. contributed by Vajrasky Kok.
- Issue #19018: The heapq.merge() function no longer suppresses IndexError
in the underlying iterables.
- Issue #18784: The uuid module no more attempts to load libc via ctypes.CDLL, - Issue #18784: The uuid module no more attempts to load libc via ctypes.CDLL,
if all necessary functions are already found in libuuid. if all necessary functions are already found in libuuid.
Patch by Evgeny Sologubov. Patch by Evgeny Sologubov.
......
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