From 01fcaa64c3327f45ec2245b038b40e72cc32c141 Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Sun, 29 May 2016 13:58:14 +0200 Subject: [PATCH] fix #1162 --- test/mitmproxy/test_protocol_http2.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/mitmproxy/test_protocol_http2.py b/test/mitmproxy/test_protocol_http2.py index 07f67b74a..4a7620147 100644 --- a/test/mitmproxy/test_protocol_http2.py +++ b/test/mitmproxy/test_protocol_http2.py @@ -483,8 +483,11 @@ class TestConnectionLost(_Http2TestBase, _Http2ServerBase): h2_conn.receive_data(raw) except: break - client.wfile.write(h2_conn.data_to_send()) - client.wfile.flush() + try: + client.wfile.write(h2_conn.data_to_send()) + client.wfile.flush() + except: + break if len(self.master.state.flows) == 1: assert self.master.state.flows[0].response is None