diff options
Diffstat (limited to 'Lib/socket.py')
-rwxr-xr-x | Lib/socket.py | 6 |
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") |