From 8c78220b7de2a72b41710dd210798211ba85be5f Mon Sep 17 00:00:00 2001 From: Oluf Lorenzen Date: Thu, 21 Nov 2024 14:27:47 +0100 Subject: [PATCH] fix(logging.handlers.SocketHandler): properly handle unset port co-authored-by: timo eisenmann co-authored-by: veselin vasilev co-authored-by: oluf lorenzen --- Lib/logging/handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 1cba64fd554100..ad7a75e0a05383 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -583,7 +583,7 @@ def makeSocket(self, timeout=1): A factory method which allows subclasses to define the precise type of socket they want. """ - if self.port is not None: + if isinstance(self.address, tuple): result = socket.create_connection(self.address, timeout=timeout) else: result = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)