summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-01-15 22:53:46 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-01-15 22:53:46 (GMT)
commitb8c941771a5f92d68cefb1fec1636947e8a99f4e (patch)
treea6aad9f8a192b990b033198608c55bc7fe330491
parent10bc59320ca2fa3a1bf45b4b535292643b748a40 (diff)
downloadcpython-b8c941771a5f92d68cefb1fec1636947e8a99f4e.zip
cpython-b8c941771a5f92d68cefb1fec1636947e8a99f4e.tar.gz
cpython-b8c941771a5f92d68cefb1fec1636947e8a99f4e.tar.bz2
Variant of Skip's patch 103246 (Remove unneeded string exception compat from Queue).
-rw-r--r--Lib/Queue.py20
1 files changed, 7 insertions, 13 deletions
diff --git a/Lib/Queue.py b/Lib/Queue.py
index 9d5f799..0e6bbf0 100644
--- a/Lib/Queue.py
+++ b/Lib/Queue.py
@@ -1,18 +1,12 @@
"""A multi-producer, multi-consumer queue."""
-# define this exception to be compatible with Python 1.5's class
-# exceptions, but also when -X option is used.
-try:
- class Empty(Exception):
- pass
- class Full(Exception):
- pass
-except TypeError:
- # string based exceptions
- # exception raised by get(block=0)/get_nowait()
- Empty = 'Queue.Empty'
- # exception raised by put(block=0)/put_nowait()
- Full = 'Queue.Full'
+class Empty(Exception):
+ "Exception raised by Queue.get(block=0)/get_nowait()."
+ pass
+
+class Full(Exception):
+ "Exception raised by Queue.put(block=0)/put_nowait()."
+ pass
class Queue:
def __init__(self, maxsize=0):