Skip to content

Commit 0a4ae70

Browse files
committed
Close RPC connection in RawProxy.__del__()
Mainly adding this to prevent ResourceWarning's on py3.
1 parent a1a1219 commit 0a4ae70

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bitcoin/rpc.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ def _get_response(self):
190190
return json.loads(http_response.read().decode('utf8'),
191191
parse_float=decimal.Decimal)
192192

193+
def __del__(self):
194+
self.__conn.close()
195+
193196

194197
class Proxy(RawProxy):
195198
def __init__(self, service_url=None,

0 commit comments

Comments
 (0)