diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index f9b2799d25bfd0..8afceacae68b71 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -90,6 +90,12 @@ class FakeHTTPConnection(http.client.HTTPConnection): def connect(self): self.sock = FakeSocket(self.fakedata) type(self).fakesock = self.sock + + def close(self): + # bpo-36918: Don't bother to track exactly I/O references + # of FakeSocket: do nothing to silence finalizer exception + pass + FakeHTTPConnection.fakedata = fakedata return FakeHTTPConnection