Skip to content

Commit 5b37b49

Browse files
authored
gh-74166: break cycle by clearing the list instead of dropping its reference (GH-91685)
1 parent e590379 commit 5b37b49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/socket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
851851
raise ExceptionGroup("create_connection failed", exceptions)
852852
finally:
853853
# Break explicitly a reference cycle
854-
exceptions = None
854+
exceptions.clear()
855855
else:
856856
raise error("getaddrinfo returns an empty list")
857857

0 commit comments

Comments
 (0)