]> granicus.if.org Git - python/commitdiff
Issue #18676: Change 'positive' to 'non-negative' in queue.py put and get
authorTerry Jan Reedy <tjreedy@udel.edu>
Sat, 10 Aug 2013 22:17:13 +0000 (18:17 -0400)
committerTerry Jan Reedy <tjreedy@udel.edu>
Sat, 10 Aug 2013 22:17:13 +0000 (18:17 -0400)
docstrings and ValueError messages. Patch by Zhongyue Luo

Lib/queue.py
Misc/ACKS
Misc/NEWS

index c3296fe1382ce77d608894c60712ff8e22edf3f2..3cee36b8961e0b95e3fdb3dc69a11bffebabdee5 100644 (file)
@@ -120,7 +120,7 @@ class Queue:
 
         If optional args 'block' is true and 'timeout' is None (the default),
         block if necessary until a free slot is available. If 'timeout' is
-        a positive number, it blocks at most 'timeout' seconds and raises
+        a non-negative number, it blocks at most 'timeout' seconds and raises
         the Full exception if no free slot was available within that time.
         Otherwise ('block' is false), put an item on the queue if a free slot
         is immediately available, else raise the Full exception ('timeout'
@@ -135,7 +135,7 @@ class Queue:
                     while self._qsize() >= self.maxsize:
                         self.not_full.wait()
                 elif timeout < 0:
-                    raise ValueError("'timeout' must be a positive number")
+                    raise ValueError("'timeout' must be a non-negative number")
                 else:
                     endtime = time() + timeout
                     while self._qsize() >= self.maxsize:
@@ -152,7 +152,7 @@ class Queue:
 
         If optional args 'block' is true and 'timeout' is None (the default),
         block if necessary until an item is available. If 'timeout' is
-        a positive number, it blocks at most 'timeout' seconds and raises
+        a non-negative number, it blocks at most 'timeout' seconds and raises
         the Empty exception if no item was available within that time.
         Otherwise ('block' is false), return an item if one is immediately
         available, else raise the Empty exception ('timeout' is ignored
@@ -166,7 +166,7 @@ class Queue:
                 while not self._qsize():
                     self.not_empty.wait()
             elif timeout < 0:
-                raise ValueError("'timeout' must be a positive number")
+                raise ValueError("'timeout' must be a non-negative number")
             else:
                 endtime = time() + timeout
                 while not self._qsize():
index 2d3b929f323aeca10d297c836a658dd8e6effb21..349c70e2db6c03ccbd6d3b8fa06ea8e26a206f50 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -753,6 +753,7 @@ Ray Loyzaga
 Lukas Lueg
 Loren Luke
 Fredrik Lundh
+Zhongyue Luo
 Mark Lutz
 Jim Lynch
 Mikael Lyngvig
index db8a418524f57fd2d62361db0f8c1e14e8ebcafb..4401418d76578ad39c1c0727ec6cd9dbca990c0b 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -64,6 +64,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #18676: Change 'positive' to 'non-negative' in queue.py put and get
+  docstrings and ValueError messages. Patch by Zhongyue Luo
+
 - Issue #18681: Fix a NameError in imp.reload() (noticed by Weizhao Li).
 
 - Issue #8112: xlmrpc.server's DocXMLRPCServer server no longer raises an error