Skip to content
Snippets Groups Projects
Commit 20a9d823 authored by Patrick Mézard's avatar Patrick Mézard
Browse files

pure/base85: align exception type/msg on base85.c

brendan mentioned on IRC that b64decode raises a TypeError too, but while the
previous exception type may be better in general, it is much easier to make it
behave like the related C code and changes nothing for mercurial itself.
parent b767382a
No related branches found
No related tags found
No related merge requests found
......@@ -54,5 +54,6 @@
try:
acc = acc * 85 + _b85dec[c]
except KeyError:
raise TypeError('Bad base85 character at byte %d' % (i + j))
raise ValueError('bad base85 character at position %d'
% (i + j))
if acc > 4294967295:
......@@ -58,5 +59,5 @@
if acc > 4294967295:
raise OverflowError('Base85 overflow in hunk starting at byte %d' % i)
raise ValueError('Base85 overflow in hunk starting at byte %d' % i)
out.append(acc)
# Pad final chunk if necessary
......
......@@ -496,9 +496,6 @@
mercurial/patch.py:0:
> except:
warning: naked except clause
mercurial/pure/base85.py:0:
> raise OverflowError('Base85 overflow in hunk starting at byte %d' % i)
warning: line over 80 characters
mercurial/pure/mpatch.py:0:
> frags.extend(reversed(new)) # what was left at the end
warning: line over 80 characters
......
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