diff --git a/mercurial/pure/base85.py b/mercurial/pure/base85.py --- a/mercurial/pure/base85.py +++ b/mercurial/pure/base85.py @@ -54,9 +54,10 @@ def b85decode(text): 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: - 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 diff --git a/tests/test-check-code-hg.t b/tests/test-check-code-hg.t --- a/tests/test-check-code-hg.t +++ b/tests/test-check-code-hg.t @@ -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