# HG changeset patch # User Augie Fackler # Date 2018-08-10 07:33:38 # Node ID 730e7d92a023a43ed8f6e205ceb6df03045db21c # Parent a2fa7247ca70976daa3986023e775fb254b6934d debugcommands: urlerror only has a read() method in Python 2 Differential Revision: https://phab.mercurial-scm.org/D4258 diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -3207,7 +3207,8 @@ def debugwireproto(ui, repo, path=None, res = opener.open(req) body = res.read() except util.urlerr.urlerror as e: - e.read() + # read() method must be called, but only exists in Python 2 + getattr(e, 'read', lambda: None)() continue if res.headers.get('Content-Type') == 'application/mercurial-cbor':