# HG changeset patch # User Augie Fackler # Date 1518565607 18000 # Node ID 59affe7e01d4df54acc91829fe7caf4e8020eea1 # Parent b42c47b8c9d4c4f8c396915aa70d87a328a521b4 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 diff -r b42c47b8c9d4 -r 59affe7e01d4 hgext/histedit.py --- 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)