Merge #8839: test: Avoid ConnectionResetErrors during RPC tests

1d28faf test: Avoid ConnectionResetErrors during RPC tests (Wladimir J. van der Laan)
This commit is contained in:
Wladimir J. van der Laan 2016-09-30 12:35:17 +02:00 committed by Alexander Block
parent 942fe0ed49
commit 6b1842af87

View File

@ -130,8 +130,9 @@ class AuthServiceProxy(object):
return self._get_response()
else:
raise
except BrokenPipeError:
# Python 3.5+ raises this instead of BadStatusLine when the connection was reset
except (BrokenPipeError,ConnectionResetError):
# Python 3.5+ raises BrokenPipeError instead of BadStatusLine when the connection was reset
# ConnectionResetError happens on FreeBSD with Python 3.4
self.__conn.close()
self.__conn.request(method, path, postdata, headers)
return self._get_response()