mercurial/debugcommands.py
changeset 39065 730e7d92a023
parent 39064 a2fa7247ca70
child 39080 5c99486fcfe1
equal deleted inserted replaced
39064:a2fa7247ca70 39065:730e7d92a023
  3205 
  3205 
  3206             try:
  3206             try:
  3207                 res = opener.open(req)
  3207                 res = opener.open(req)
  3208                 body = res.read()
  3208                 body = res.read()
  3209             except util.urlerr.urlerror as e:
  3209             except util.urlerr.urlerror as e:
  3210                 e.read()
  3210                 # read() method must be called, but only exists in Python 2
       
  3211                 getattr(e, 'read', lambda: None)()
  3211                 continue
  3212                 continue
  3212 
  3213 
  3213             if res.headers.get('Content-Type') == 'application/mercurial-cbor':
  3214             if res.headers.get('Content-Type') == 'application/mercurial-cbor':
  3214                 ui.write(_('cbor> %s\n') %
  3215                 ui.write(_('cbor> %s\n') %
  3215                          stringutil.pprint(cbor.loads(body), bprefix=True))
  3216                          stringutil.pprint(cbor.loads(body), bprefix=True))