Skip to content

Commit 1d28faf

Browse files
committed
test: Avoid ConnectionResetErrors during RPC tests
This is necessary on FreeBSD and MacOSX, at least. See bitcoin#8834 (comment)
1 parent 2dd57e4 commit 1d28faf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

qa/rpc-tests/test_framework/authproxy.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ def _request(self, method, path, postdata):
130130
return self._get_response()
131131
else:
132132
raise
133-
except BrokenPipeError:
134-
# Python 3.5+ raises this instead of BadStatusLine when the connection was reset
133+
except (BrokenPipeError,ConnectionResetError):
134+
# Python 3.5+ raises BrokenPipeError instead of BadStatusLine when the connection was reset
135+
# ConnectionResetError happens on FreeBSD with Python 3.4
135136
self.__conn.close()
136137
self.__conn.request(method, path, postdata, headers)
137138
return self._get_response()

0 commit comments

Comments
 (0)