summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2016-09-08 00:24:12 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2016-09-08 00:24:12 (GMT)
commit93e6b3314daf8e8c7e209118a0b095463a61394b (patch)
treeb4c871728db62be3a9e457cae64dfc4f73c72d13 /Lib/logging
parent52794db825caa62e1a066dce4bd95bde2fe80216 (diff)
parentd61910c598876788c9b4bf0e116370bbfc5a2f85 (diff)
downloadcpython-93e6b3314daf8e8c7e209118a0b095463a61394b.zip
cpython-93e6b3314daf8e8c7e209118a0b095463a61394b.tar.gz
cpython-93e6b3314daf8e8c7e209118a0b095463a61394b.tar.bz2
Closes #27930: Merged fix from 3.5.
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/handlers.py17
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