Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8c9417

Browse files
committed
Variant of Skip's patch 103246 (Remove unneeded string exception compat from Queue).
1 parent 10bc593 commit b8c9417

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

Lib/Queue.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
"""A multi-producer, multi-consumer queue."""
22

3-
# define this exception to be compatible with Python 1.5's class
4-
# exceptions, but also when -X option is used.
5-
try:
6-
class Empty(Exception):
7-
pass
8-
class Full(Exception):
9-
pass
10-
except TypeError:
11-
# string based exceptions
12-
# exception raised by get(block=0)/get_nowait()
13-
Empty = 'Queue.Empty'
14-
# exception raised by put(block=0)/put_nowait()
15-
Full = 'Queue.Full'
3+
class Empty(Exception):
4+
"Exception raised by Queue.get(block=0)/get_nowait()."
5+
pass
6+
7+
class Full(Exception):
8+
"Exception raised by Queue.put(block=0)/put_nowait()."
9+
pass
1610

1711
class Queue:
1812
def __init__(self, maxsize=0):

0 commit comments

Comments
 (0)