mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-24 04:14:57 +08:00
netlib: always disconnect when using context manager
This commit is contained in:
@@ -580,8 +580,10 @@ class _Connection(object):
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _closer(client):
|
||||
yield
|
||||
client.close()
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
client.close()
|
||||
|
||||
|
||||
class TCPClient(_Connection):
|
||||
|
||||
Reference in New Issue
Block a user