summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2005-09-16 10:33:40 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2005-09-16 10:33:40 (GMT)
commit116f16e4ab9a7cc319ca42ae24221d203d0d8f26 (patch)
treed92488708e9a3fe6430021ab60b165653f761424 /Lib
parent9bda1d6f645bd0f3e76c14f27bbbac919814cd38 (diff)
downloadcpython-116f16e4ab9a7cc319ca42ae24221d203d0d8f26.zip
cpython-116f16e4ab9a7cc319ca42ae24221d203d0d8f26.tar.gz
cpython-116f16e4ab9a7cc319ca42ae24221d203d0d8f26.tar.bz2
Added lock acquisition around handler removal from logger
Diffstat (limited to 'Lib')
-rw-r--r--Lib/logging/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index cee5fa2..4dab918 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -1090,7 +1090,11 @@ class Logger(Filterer):
"""
if hdlr in self.handlers:
#hdlr.close()
- self.handlers.remove(hdlr)
+ hdlr.acquire()
+ try:
+ self.handlers.remove(hdlr)
+ finally:
+ hdlr.release()
def callHandlers(self, record):
"""