mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
bpo-36820: Break unnecessary cycle in socket.py, codeop.py and dyld.py (GH-13135)
Break cycle generated when saving an exception in socket.py, codeop.py and dyld.py as they keep alive not only the exception but user objects through the ``__traceback__`` attribute. https://bugs.python.org/issue36820 Automerge-Triggered-By: @pablogsal
This commit is contained in:
parent
efefe25443
commit
b64334cb93
4 changed files with 17 additions and 5 deletions
|
@ -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")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue