diff options
| author | Tim Peters <tim.peters@gmail.com> | 2001-01-15 22:53:46 +0000 |
|---|---|---|
| committer | Tim Peters <tim.peters@gmail.com> | 2001-01-15 22:53:46 +0000 |
| commit | e6d6aca163c8cc1a460bea8cf3694ade858edb7f (patch) | |
| tree | 8b200c9d50b2001d314c0b2e33da23255bc9b342 /Lib | |
| parent | 49b8869fecfe09566b3c60a3ac3b0d5b9dc9914d (diff) | |
| download | cpython-e6d6aca163c8cc1a460bea8cf3694ade858edb7f.tar.gz | |
Variant of Skip's patch 103246 (Remove unneeded string exception compat from Queue).
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/Queue.py | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/Lib/Queue.py b/Lib/Queue.py index 9d5f79980c..0e6bbf055a 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): |
