From 5a8ab591c66c8569dd3f43e6c04dd451641a4673 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 24 Aug 2018 14:09:28 +0400 Subject: [PATCH] test_https: Fix Windows error exception type --- test/with_dummyserver/test_https.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/with_dummyserver/test_https.py b/test/with_dummyserver/test_https.py index 6e558d3561..082ede96f8 100644 --- a/test/with_dummyserver/test_https.py +++ b/test/with_dummyserver/test_https.py @@ -38,6 +38,7 @@ SystemTimeWarning, InsecurePlatformWarning, MaxRetryError, + ProtocolError, ) from urllib3.packages import six from urllib3.util.timeout import Timeout @@ -102,8 +103,11 @@ def test_client_no_intermediate(self): 'unknown Cert Authority' in str(e) or # https://github.com/urllib3/urllib3/issues/1422 'connection closed via error' in str(e) or - 'WSAECONNRESET' in str(e) or - 'An existing connection was forcibly closed by the remote host' in str(e)): + 'WSAECONNRESET' in str(e)): + raise + except ProtocolError as e: + # https://github.com/urllib3/urllib3/issues/1422 + if not ('An existing connection was forcibly closed by the remote host' in str(e)): raise def test_verified(self):