From c0786e94339224f519e268dae15c301b151ca4c4 Mon Sep 17 00:00:00 2001 From: Stephan Lachnit Date: Fri, 13 Mar 2026 13:15:24 +0100 Subject: [PATCH] logging: use new syntax to check if a handler is not already present in Logger.addHandler --- Lib/logging/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 39689a57e6ecd6..46e2873ae48594 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -1682,7 +1682,7 @@ def addHandler(self, hdlr): Add the specified handler to this logger. """ with _lock: - if not (hdlr in self.handlers): + if hdlr not in self.handlers: self.handlers.append(hdlr) def removeHandler(self, hdlr):