mercurial/templatefuncs.py
changeset 49248 63fd0282ad40
parent 48929 278030cc9353
child 50540 164b6c4878b8
--- a/mercurial/templatefuncs.py	Mon May 30 00:45:00 2022 +0200
+++ b/mercurial/templatefuncs.py	Mon May 30 16:18:12 2022 +0200
@@ -6,6 +6,7 @@
 # GNU General Public License version 2 or any later version.
 
 
+import binascii
 import re
 
 from .i18n import _
@@ -769,7 +770,7 @@
     elif len(hexnode) == hexnodelen:
         try:
             node = bin(hexnode)
-        except TypeError:
+        except binascii.Error:
             return hexnode
     else:
         try: