diff --git a/Lib/sched.py b/Lib/sched.py index ccf8ce90742..b9a7ad1afa2 100644 --- a/Lib/sched.py +++ b/Lib/sched.py @@ -165,4 +165,4 @@ class scheduler: # the actual order they would be retrieved. with self._lock: events = self._queue[:] - return map(heapq.heappop, [events]*len(events)) + return list(map(heapq.heappop, [events]*len(events))) diff --git a/Lib/test/test_sched.py b/Lib/test/test_sched.py index 1fe6ad442cb..070886d1ea5 100644 --- a/Lib/test/test_sched.py +++ b/Lib/test/test_sched.py @@ -172,7 +172,7 @@ class TestCase(unittest.TestCase): e3 = scheduler.enterabs(now + 0.03, 1, fun) # queue property is supposed to return an order list of # upcoming events - self.assertEqual(list(scheduler.queue), [e1, e2, e3, e4, e5]) + self.assertEqual(scheduler.queue, [e1, e2, e3, e4, e5]) def test_args_kwargs(self): flag = [] diff --git a/Misc/NEWS b/Misc/NEWS index 4f90cae3a3b..4ecef291c9b 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -50,6 +50,9 @@ Library - Issue #18431: The new email header parser now decodes RFC2047 encoded words in structured headers. +- Issue #18432: The sched module's queue method was incorrectly returning + an iterator instead of a list. + - Issue #18044: The new email header parser was mis-parsing encoded words where an encoded character immediately followed the '?' that follows the CTE character, resulting in a decoding failure. They are now decoded correctly.