aboutsummaryrefslogtreecommitdiffstats
path: root/netlib
diff options
context:
space:
mode:
Diffstat (limited to 'netlib')
-rw-r--r--netlib/tcp.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/netlib/tcp.py b/netlib/tcp.py
index 46c28cd9..6b7540aa 100644
--- a/netlib/tcp.py
+++ b/netlib/tcp.py
@@ -253,7 +253,10 @@ class _Connection(object):
# Closing the socket is not our task, therefore we don't call close then.
if type(self.connection) != SSL.Connection:
if not getattr(self.wfile, "closed", False):
- self.wfile.flush()
+ try:
+ self.wfile.flush()
+ except NetLibDisconnect:
+ pass
self.wfile.close()
self.rfile.close()