histedit: binascii.unhexlify (aka node.bin) throws new exception type on py3
Lucky for us, the exception type exists on 2.7, so we can include it
in the except block without any extra work.
Differential Revision: https://phab.mercurial-scm.org/D2244
--- a/hgext/histedit.py Tue Feb 13 13:23:18 2018 -0800
+++ b/hgext/histedit.py Tue Feb 13 18:46:47 2018 -0500
@@ -183,6 +183,7 @@
from __future__ import absolute_import
+import binascii
import errno
import os
@@ -425,7 +426,7 @@
rulehash = rule.strip().split(' ', 1)[0]
try:
rev = node.bin(rulehash)
- except TypeError:
+ except (TypeError, binascii.Error):
raise error.ParseError("invalid changeset %s" % rulehash)
return cls(state, rev)