--- a/hgext/phabricator.py Thu Dec 20 09:59:16 2018 +0100
+++ b/hgext/phabricator.py Sat Dec 29 01:51:02 2018 -0500
@@ -41,6 +41,7 @@
from __future__ import absolute_import
+import contextlib
import itertools
import json
import operator
@@ -214,7 +215,8 @@
else:
urlopener = urlmod.opener(repo.ui, authinfo)
request = util.urlreq.request(url, data=data)
- body = urlopener.open(request).read()
+ with contextlib.closing(urlopener.open(request)) as rsp:
+ body = rsp.read()
repo.ui.debug(b'Conduit Response: %s\n' % body)
parsed = json.loads(body)
if parsed.get(r'error_code'):