diff options
Diffstat (limited to 'Lib/logging/handlers.py')
-rw-r--r-- | Lib/logging/handlers.py | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index ba00a69..7d77973 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -1388,7 +1388,6 @@ if threading: """ self.queue = queue self.handlers = handlers - self._stop = threading.Event() self._thread = None self.respect_handler_level = respect_handler_level @@ -1409,7 +1408,7 @@ if threading: LogRecords to process. """ self._thread = t = threading.Thread(target=self._monitor) - t.setDaemon(True) + t.daemon = True t.start() def prepare(self , record): @@ -1448,20 +1447,9 @@ if threading: """ q = self.queue has_task_done = hasattr(q, 'task_done') - while not self._stop.isSet(): - try: - record = self.dequeue(True) - if record is self._sentinel: - break - self.handle(record) - if has_task_done: - q.task_done() - except queue.Empty: - pass - # There might still be records in the queue. while True: try: - record = self.dequeue(False) + record = self.dequeue(True) if record is self._sentinel: break self.handle(record) @@ -1488,7 +1476,6 @@ if threading: Note that if you don't call this before your application exits, there may be some records still left on the queue, which won't be processed. """ - self._stop.set() self.enqueue_sentinel() self._thread.join() self._thread = None |