]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-74166: break cycle by clearing the list instead of dropping its reference (GH...
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Tue, 19 Apr 2022 09:09:10 +0000 (10:09 +0100)
committerGitHub <noreply@github.com>
Tue, 19 Apr 2022 09:09:10 +0000 (10:09 +0100)
Lib/socket.py

index 97362d92f64656f45e8f7e24e36fbb52f7aaf8ad..28d9c89d601aa3b40a59e82b0badb90ac50e1a6c 100755 (executable)
@@ -851,7 +851,7 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
             raise ExceptionGroup("create_connection failed", exceptions)
         finally:
             # Break explicitly a reference cycle
-            exceptions = None
+            exceptions.clear()
     else:
         raise error("getaddrinfo returns an empty list")