diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2013-08-10 18:17:13 -0400 |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2013-08-10 18:17:13 -0400 |
commit | 7608b607b1b40353a01da15ff6b2240539446a09 (patch) | |
tree | e9005dd8db7e0740064f1364a74ef230ef10d907 /Lib/queue.py | |
parent | a594c63d662ca96da44043578fd78cadfe562b5a (diff) | |
download | cpython-git-7608b607b1b40353a01da15ff6b2240539446a09.tar.gz |
Issue #18676: Change 'positive' to 'non-negative' in queue.py put and get
docstrings and ValueError messages. Patch by Zhongyue Luo
Diffstat (limited to 'Lib/queue.py')
-rw-r--r-- | Lib/queue.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/queue.py b/Lib/queue.py index c3296fe138..3cee36b896 100644 --- a/Lib/queue.py +++ b/Lib/queue.py @@ -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(): |