Fix interrupted HTTP RPC connection workaround for Python 3.5+

This commit is contained in:
Pieter Wuille
2017-03-24 18:43:21 +13:00
committed by Jack Grigg
parent 17694e4bcf
commit 2edad86b2d
+5
View File
@@ -125,6 +125,11 @@ class AuthServiceProxy(object):
return self._get_response()
else:
raise
except BrokenPipeError:
# Python 3.5+ raises this instead of BadStatusLine when the connection was reset
self.__conn.close()
self.__conn.request(method, path, postdata, headers)
return self._get_response()
def __call__(self, *args):
AuthServiceProxy.__id_count += 1