Kaydet (Commit) 32fb6a81 authored tarafından Vinay Sajip's avatar Vinay Sajip

Issue #9945: logging: Fixed locking bugs in addHandler/removeHandler.

üst fda2106a
...@@ -1226,19 +1226,23 @@ class Logger(Filterer): ...@@ -1226,19 +1226,23 @@ class Logger(Filterer):
""" """
Add the specified handler to this logger. Add the specified handler to this logger.
""" """
if not (hdlr in self.handlers): _acquireLock()
self.handlers.append(hdlr) try:
if not (hdlr in self.handlers):
self.handlers.append(hdlr)
finally:
_releaseLock()
def removeHandler(self, hdlr): def removeHandler(self, hdlr):
""" """
Remove the specified handler from this logger. Remove the specified handler from this logger.
""" """
if hdlr in self.handlers: _acquireLock()
hdlr.acquire() try:
try: if hdlr in self.handlers:
self.handlers.remove(hdlr) self.handlers.remove(hdlr)
finally: finally:
hdlr.release() _releaseLock()
def hasHandlers(self): def hasHandlers(self):
""" """
......
...@@ -68,6 +68,8 @@ Core and Builtins ...@@ -68,6 +68,8 @@ Core and Builtins
Library Library
------- -------
- Issue #9945: logging: Fixed locking bugs in addHandler/removeHandler.
- Issue #9936: Fixed executable lines' search in the trace module. - Issue #9936: Fixed executable lines' search in the trace module.
- Issue #9790: Rework imports necessary for samefile and sameopenfile - Issue #9790: Rework imports necessary for samefile and sameopenfile
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment