# HG changeset patch # User Pierre-Yves David # Date 1573931269 -3600 # Node ID 4394687b298b0f72a1d7b54d798860ffdaa62863 # Parent 856cce0c255cc6ffbe164764cc152e3011c59fd7 pure: use string for exception in the pure version of base85 Without this change, running the test with python3 and --pure gives the following error:: --- /home/marmoute/src/mercurial-dev/tests/test-import-git.t +++ /home/marmoute/src/mercurial-dev/tests/test-import-git.t.err @@ -518,7 +518,7 @@ > > EOF applying patch from stdin - abort: could not decode "binary2" binary patch: bad base85 character at position 6 + abort: could not decode "binary2" binary patch: b'bad base85 character at position 6' [255] $ hg revert -aq To make the cext implementation, we use a "native" string for the exception. This fix the test failure. diff -r 856cce0c255c -r 4394687b298b mercurial/pure/base85.py --- a/mercurial/pure/base85.py Tue Nov 12 11:05:03 2019 +0100 +++ b/mercurial/pure/base85.py Sat Nov 16 20:07:49 2019 +0100 @@ -67,7 +67,7 @@ acc = acc * 85 + _b85dec[c] except KeyError: raise ValueError( - b'bad base85 character at position %d' % (i + j) + 'bad base85 character at position %d' % (i + j) ) if acc > 4294967295: raise ValueError(b'Base85 overflow in hunk starting at byte %d' % i)