Mercurial > public > mercurial-scm > hg-stable
diff mercurial/wireprotov1server.py @ 41482:9cb51e74e9ad
wireprotov1server: use binascii.unhexlify
The "hex" codec doesn't exist in Python 3. We could use
`codecs.decode(h, 'hex_codec')`. But `binascii.unhexlify()`
exists and should work the same on Python 2 and 3.
Differential Revision: https://phab.mercurial-scm.org/D5755
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 30 Jan 2019 13:07:20 -0800 |
parents | 876494fd967d |
children | d6569f1e9b37 |
line wrap: on
line diff
--- a/mercurial/wireprotov1server.py Wed Jan 30 12:55:44 2019 -0800 +++ b/mercurial/wireprotov1server.py Wed Jan 30 13:07:20 2019 -0800 @@ -7,6 +7,7 @@ from __future__ import absolute_import +import binascii import os from .i18n import _ @@ -344,7 +345,7 @@ one specific branch of many. """ def decodehexstring(s): - return set([h.decode('hex') for h in s.split(';')]) + return set([binascii.unhexlify(h) for h in s.split(';')]) manifest = repo.vfs.tryread('pullbundles.manifest') if not manifest: