
python-checkins at python
Aug 10, 2013, 3:40 PM
Post #1 of 1
(9 views)
Permalink
|
|
cpython (3.3): Issue #18676: Change 'positive' to 'non-negative' in queue.py put and get
|
|
http://hg.python.org/cpython/rev/2122d56d6bc5 changeset: 85114:2122d56d6bc5 branch: 3.3 parent: 85109:9eea6401b892 user: Terry Jan Reedy <tjreedy [at] udel> date: Sat Aug 10 18:17:13 2013 -0400 summary: Issue #18676: Change 'positive' to 'non-negative' in queue.py put and get docstrings and ValueError messages. Patch by Zhongyue Luo files: Lib/queue.py | 8 ++++---- Misc/ACKS | 1 + Misc/NEWS | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Lib/queue.py b/Lib/queue.py --- a/Lib/queue.py +++ b/Lib/queue.py @@ -120,7 +120,7 @@ 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 @@ 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 @@ 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 @@ 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(): diff --git a/Misc/ACKS b/Misc/ACKS --- a/Misc/ACKS +++ b/Misc/ACKS @@ -753,6 +753,7 @@ Lukas Lueg Loren Luke Fredrik Lundh +Zhongyue Luo Mark Lutz Jim Lynch Mikael Lyngvig diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -64,6 +64,9 @@ 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 -- Repository URL: http://hg.python.org/cpython
|