diff options
-rw-r--r-- | python/qpid/queue.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/python/qpid/queue.py b/python/qpid/queue.py index 830ea6060d..c9f4d1d1d0 100644 --- a/python/qpid/queue.py +++ b/python/qpid/queue.py @@ -60,19 +60,19 @@ class Queue(BaseQueue): if listener is None and exc_listener is not None: raise ValueError("cannot set exception listener without setting listener") - self.listener = listener - self.exc_listener = exc_listener - if listener is None: if self.thread is not None: self.put(Queue.STOP) self.thread.join() self.thread = None - else: - if self.thread is None: - self.thread = Thread(target = self.run) - self.thread.setDaemon(True) - self.thread.start() + + self.listener = listener + self.exc_listener = exc_listener + + if listener is not None and self.thread is None: + self.thread = Thread(target = self.run) + self.thread.setDaemon(True) + self.thread.start() def run(self): while True: |