Skip to content

Commit c0786e9

Browse files
logging: use new syntax to check if a handler is not already present in Logger.addHandler
1 parent 0b6a234 commit c0786e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/logging/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@ def addHandler(self, hdlr):
16821682
Add the specified handler to this logger.
16831683
"""
16841684
with _lock:
1685-
if not (hdlr in self.handlers):
1685+
if hdlr not in self.handlers:
16861686
self.handlers.append(hdlr)
16871687

16881688
def removeHandler(self, hdlr):

0 commit comments

Comments
 (0)