summaryrefslogtreecommitdiffstats
path: root/Lib/socket.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/socket.py')
-rwxr-xr-xLib/socket.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/socket.py b/Lib/socket.py
index 84a5dcb..374f112 100755
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -839,7 +839,11 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
sock.close()
if err is not None:
- raise err
+ try:
+ raise err
+ finally:
+ # Break explicitly a reference cycle
+ err = None
else:
raise error("getaddrinfo returns an empty list")