Skip to content
Snippets Groups Projects
Commit 4394687b298b authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

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.
parent 856cce0c255c
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment