aboutsummaryrefslogtreecommitdiffstats
path: root/netlib
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-06-07 12:56:51 +1200
committerAldo Cortesi <aldo@nullcube.com>2016-06-07 12:56:51 +1200
commit75ebd638eb6f6ed74f1f191d4f9e30277f4f2d34 (patch)
tree9bff77b84d485549f2d9cfad61a4c54b6315088d /netlib
parente037fe05ff1f0c2893b3f51e06e0261ca4245d63 (diff)
parent80292c0ac3c9684ee945546c9b45334178518e4e (diff)
downloadmitmproxy-75ebd638eb6f6ed74f1f191d4f9e30277f4f2d34.tar.gz
mitmproxy-75ebd638eb6f6ed74f1f191d4f9e30277f4f2d34.tar.bz2
mitmproxy-75ebd638eb6f6ed74f1f191d4f9e30277f4f2d34.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'netlib')
-rw-r--r--netlib/tcp.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/netlib/tcp.py b/netlib/tcp.py
index de12102e..0eec326b 100644
--- a/netlib/tcp.py
+++ b/netlib/tcp.py
@@ -580,8 +580,10 @@ class _Connection(object):
@contextlib.contextmanager
def _closer(client):
- yield
- client.close()
+ try:
+ yield
+ finally:
+ client.close()
class TCPClient(_Connection):