Kaydet (Commit) acb9fa79 authored tarafından Victor Stinner's avatar Victor Stinner Kaydeden (comit) GitHub

bpo-31234, socket.create_connection(): Fix ref cycle (#3546)

üst b157ce1e
......@@ -711,6 +711,8 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
if source_address:
sock.bind(source_address)
sock.connect(sa)
# Break explicitly a reference cycle
err = None
return sock
except error as _:
......
socket.create_connection() now fixes manually a reference cycle: clear the
variable storing the last exception on success.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment