]> granicus.if.org Git - python/commitdiff
Variant of Skip's patch 103246 (Remove unneeded string exception compat from Queue).
authorTim Peters <tim.peters@gmail.com>
Mon, 15 Jan 2001 22:53:46 +0000 (22:53 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 15 Jan 2001 22:53:46 +0000 (22:53 +0000)
Lib/Queue.py

index 9d5f79980cff0a5fd9f59296f484e5bdf80631bd..0e6bbf055a469a4e2013c60219e36bd7ac5e5d2b 100644 (file)
@@ -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):