Skip to content

Commit f087f6b

Browse files
author
spirit
committed
Minor
1 parent 9907cc8 commit f087f6b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎language_tool/__init__.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,11 @@ def terminate_server():
505505
class ClosingHTTPResponse(http.client.HTTPResponse):
506506
def __init__(self, sock, *args, **kwargs):
507507
super().__init__(sock, *args, **kwargs)
508-
self.sock = sock
508+
self._socket_close = sock.close
509509

510-
def __exit__(self, exc_type, exc_value, traceback):
511-
self.sock.close()
512-
return super().__exit__(exc_type, exc_value, traceback)
510+
def close(self):
511+
super().close()
512+
self._socket_close()
513513

514514
class ClosingHTTPConnection(http.client.HTTPConnection):
515515
response_class = ClosingHTTPResponse

0 commit comments

Comments
 (0)