]> git.ipfire.org Git - thirdparty/Python/cpython.git/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:01 +0000 (18:17 -0400)
committerTerry Jan Reedy <tjreedy@udel.edu>
Sat, 10 Aug 2013 22:17:01 +0000 (18:17 -0400)
docstrings and ValueError messages. Patch by Zhongyue Luo

Lib/Queue.py
Misc/ACKS
Misc/NEWS

index 2db8d76966535ac458d5f21ab5533dd4aca8297b..00364b39bebbb83ec33722b7faa1e10ba95af678 100644 (file)
@@ -109,7 +109,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'
@@ -125,7 +125,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
@@ -167,7 +167,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 736887d62d831b6763f6b2d0a7a2c7811f519358..fae831e85cda0c4f4ea1e0722c28cd03f60058f8 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -629,6 +629,7 @@ Ray Loyzaga
 Lukas Lueg
 Loren Luke
 Fredrik Lundh
+Zhongyue Luo
 Mark Lutz
 Jim Lynch
 Mikael Lyngvig
index 7e346d0f53a02e0b43b443e3884a22e678201465..c9b7fdc6d2559f341a058d1ab6e734550e34a3cb 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -29,6 +29,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 #17998: Fix an internal error in regular expression engine.
 
 - Issue #17557: Fix os.getgroups() to work with the modified behavior of