diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2005-09-16 10:33:40 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2005-09-16 10:33:40 (GMT) |
commit | 116f16e4ab9a7cc319ca42ae24221d203d0d8f26 (patch) | |
tree | d92488708e9a3fe6430021ab60b165653f761424 /Lib/logging | |
parent | 9bda1d6f645bd0f3e76c14f27bbbac919814cd38 (diff) | |
download | cpython-116f16e4ab9a7cc319ca42ae24221d203d0d8f26.zip cpython-116f16e4ab9a7cc319ca42ae24221d203d0d8f26.tar.gz cpython-116f16e4ab9a7cc319ca42ae24221d203d0d8f26.tar.bz2 |
Added lock acquisition around handler removal from logger
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/__init__.py | 6 |
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): """ |