Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 889b92d

Browse files
committed
Issue #18432: Fix unintended API change in the sched module
1 parent e6a1786 commit 889b92d

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

Lib/sched.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,4 @@ def queue(self):
165165
# the actual order they would be retrieved.
166166
with self._lock:
167167
events = self._queue[:]
168-
return map(heapq.heappop, [events]*len(events))
168+
return list(map(heapq.heappop, [events]*len(events)))

Lib/test/test_sched.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def test_queue(self):
172172
e3 = scheduler.enterabs(now + 0.03, 1, fun)
173173
# queue property is supposed to return an order list of
174174
# upcoming events
175-
self.assertEqual(list(scheduler.queue), [e1, e2, e3, e4, e5])
175+
self.assertEqual(scheduler.queue, [e1, e2, e3, e4, e5])
176176

177177
def test_args_kwargs(self):
178178
flag = []

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ Library
5050
- Issue #18431: The new email header parser now decodes RFC2047 encoded words
5151
in structured headers.
5252

53+
- Issue #18432: The sched module's queue method was incorrectly returning
54+
an iterator instead of a list.
55+
5356
- Issue #18044: The new email header parser was mis-parsing encoded words where
5457
an encoded character immediately followed the '?' that follows the CTE
5558
character, resulting in a decoding failure. They are now decoded correctly.

0 commit comments

Comments
 (0)