# HG changeset patch # User Gregory Szorc # Date 2018-08-28 22:10:56 # Node ID cdb56f295b031ace8a12bc5a08a6e8a4e2da6a66 # Parent 45d12c49c3f3e1b5feaf418f5698327a09357112 httppeer: use our CBOR decoder We just implemented our own CBOR decoder. Let's use it in httppeer. Differential Revision: https://phab.mercurial-scm.org/D4465 diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py --- a/mercurial/httppeer.py +++ b/mercurial/httppeer.py @@ -16,9 +16,6 @@ import struct import weakref from .i18n import _ -from .thirdparty import ( - cbor, -) from . import ( bundle2, error, @@ -35,6 +32,7 @@ from . import ( wireprotov2server, ) from .utils import ( + cborutil, interfaceutil, stringutil, ) @@ -913,8 +911,8 @@ def performhandshake(ui, url, opener, re if advertisev2: if ct == 'application/mercurial-cbor': try: - info = cbor.loads(rawdata) - except cbor.CBORDecodeError: + info = cborutil.decodeall(rawdata)[0] + except cborutil.CBORDecodeError: raise error.Abort(_('error decoding CBOR from remote server'), hint=_('try again and consider contacting ' 'the server operator'))