Kaydet (Commit) d99e85b9 authored tarafından Miss Islington (bot)'s avatar Miss Islington (bot) Kaydeden (comit) Victor Stinner

[3.6] bpo-31234, socket.create_connection(): Fix ref cycle (GH-3546) (#3552)

(cherry picked from commit acb9fa79)
üst 769ddb07
......@@ -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