mirror of https://github.com/python/cpython
Issue #18676: Change 'positive' to 'non-negative' in queue.py put and get
docstrings and ValueError messages. Patch by Zhongyue Luo
This commit is contained in:
parent
a594c63d66
commit
7608b607b1
|
@ -120,7 +120,7 @@ class Queue:
|
||||||
|
|
||||||
If optional args 'block' is true and 'timeout' is None (the default),
|
If optional args 'block' is true and 'timeout' is None (the default),
|
||||||
block if necessary until a free slot is available. If 'timeout' is
|
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.
|
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
|
Otherwise ('block' is false), put an item on the queue if a free slot
|
||||||
is immediately available, else raise the Full exception ('timeout'
|
is immediately available, else raise the Full exception ('timeout'
|
||||||
|
@ -135,7 +135,7 @@ class Queue:
|
||||||
while self._qsize() >= self.maxsize:
|
while self._qsize() >= self.maxsize:
|
||||||
self.not_full.wait()
|
self.not_full.wait()
|
||||||
elif timeout < 0:
|
elif timeout < 0:
|
||||||
raise ValueError("'timeout' must be a positive number")
|
raise ValueError("'timeout' must be a non-negative number")
|
||||||
else:
|
else:
|
||||||
endtime = time() + timeout
|
endtime = time() + timeout
|
||||||
while self._qsize() >= self.maxsize:
|
while self._qsize() >= self.maxsize:
|
||||||
|
@ -152,7 +152,7 @@ class Queue:
|
||||||
|
|
||||||
If optional args 'block' is true and 'timeout' is None (the default),
|
If optional args 'block' is true and 'timeout' is None (the default),
|
||||||
block if necessary until an item is available. If 'timeout' is
|
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.
|
the Empty exception if no item was available within that time.
|
||||||
Otherwise ('block' is false), return an item if one is immediately
|
Otherwise ('block' is false), return an item if one is immediately
|
||||||
available, else raise the Empty exception ('timeout' is ignored
|
available, else raise the Empty exception ('timeout' is ignored
|
||||||
|
@ -166,7 +166,7 @@ class Queue:
|
||||||
while not self._qsize():
|
while not self._qsize():
|
||||||
self.not_empty.wait()
|
self.not_empty.wait()
|
||||||
elif timeout < 0:
|
elif timeout < 0:
|
||||||
raise ValueError("'timeout' must be a positive number")
|
raise ValueError("'timeout' must be a non-negative number")
|
||||||
else:
|
else:
|
||||||
endtime = time() + timeout
|
endtime = time() + timeout
|
||||||
while not self._qsize():
|
while not self._qsize():
|
||||||
|
|
|
@ -753,6 +753,7 @@ Ray Loyzaga
|
||||||
Lukas Lueg
|
Lukas Lueg
|
||||||
Loren Luke
|
Loren Luke
|
||||||
Fredrik Lundh
|
Fredrik Lundh
|
||||||
|
Zhongyue Luo
|
||||||
Mark Lutz
|
Mark Lutz
|
||||||
Jim Lynch
|
Jim Lynch
|
||||||
Mikael Lyngvig
|
Mikael Lyngvig
|
||||||
|
|
|
@ -64,6 +64,9 @@ Core and Builtins
|
||||||
Library
|
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 #18681: Fix a NameError in imp.reload() (noticed by Weizhao Li).
|
||||||
|
|
||||||
- Issue #8112: xlmrpc.server's DocXMLRPCServer server no longer raises an error
|
- Issue #8112: xlmrpc.server's DocXMLRPCServer server no longer raises an error
|
||||||
|
|
Loading…
Reference in New Issue