]> granicus.if.org Git - python/commitdiff
Issue #18432: Fix unintended API change in the sched module
authorRaymond Hettinger <python@rcn.com>
Sun, 14 Jul 2013 05:42:09 +0000 (22:42 -0700)
committerRaymond Hettinger <python@rcn.com>
Sun, 14 Jul 2013 05:42:09 +0000 (22:42 -0700)
Lib/sched.py
Lib/test/test_sched.py
Misc/NEWS

index ccf8ce907428e1be6939c2de2f769b4f28303d3b..b9a7ad1afa2f19d9634043773b77caef6e016316 100644 (file)
@@ -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)))
index 1fe6ad442cbd4f1450fe49c99e0e2a177bdd2e7c..070886d1ea5f3b32520355738aca5add2f208bdb 100644 (file)
@@ -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 = []
index 4f90cae3a3bb15d3b6361f584978abebef0c2039..4ecef291c9b127701e21492c22a69c208e9728ad 100644 (file)
--- 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.