py3: catch binascii.Error raised from binascii.unhexlify
authorPulkit Goyal <7895pulkit@gmail.com>
Tue, 20 Jun 2017 22:11:46 +0530
changeset 32969 30d0cb279bac
parent 32968 4107eb8a5648
child 32970 11c0bb4ccc76
py3: catch binascii.Error raised from binascii.unhexlify Before Python 3, binsacii.unhexlify used to raise TypeError, now it raises binascii.Error.
mercurial/revlog.py
--- a/mercurial/revlog.py	Tue Jun 20 23:39:59 2017 -0700
+++ b/mercurial/revlog.py	Tue Jun 20 22:11:46 2017 +0530
@@ -13,6 +13,7 @@
 
 from __future__ import absolute_import
 
+import binascii
 import collections
 import errno
 import hashlib
@@ -1094,7 +1095,7 @@
                 if maybewdir:
                     raise error.WdirUnsupported
                 return None
-            except TypeError:
+            except (TypeError, binascii.Error):
                 pass
 
     def lookup(self, id):