mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
netlib: always disconnect when using context manager
This commit is contained in:
parent
ced6fb4cf9
commit
7cb7d9ad32
@ -580,8 +580,10 @@ class _Connection(object):
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _closer(client):
|
||||
yield
|
||||
client.close()
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
client.close()
|
||||
|
||||
|
||||
class TCPClient(_Connection):
|
||||
|
Loading…
Reference in New Issue
Block a user