comparison mercurial/revlog.py @ 32969:30d0cb279bac

py3: catch binascii.Error raised from binascii.unhexlify Before Python 3, binsacii.unhexlify used to raise TypeError, now it raises binascii.Error.
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 20 Jun 2017 22:11:46 +0530
parents ef015ba5ba2e
children 6d678ab1b10d
comparison
equal deleted inserted replaced
32968:4107eb8a5648 32969:30d0cb279bac
11 and O(changes) merge between branches. 11 and O(changes) merge between branches.
12 """ 12 """
13 13
14 from __future__ import absolute_import 14 from __future__ import absolute_import
15 15
16 import binascii
16 import collections 17 import collections
17 import errno 18 import errno
18 import hashlib 19 import hashlib
19 import os 20 import os
20 import struct 21 import struct
1092 raise LookupError(id, self.indexfile, 1093 raise LookupError(id, self.indexfile,
1093 _('ambiguous identifier')) 1094 _('ambiguous identifier'))
1094 if maybewdir: 1095 if maybewdir:
1095 raise error.WdirUnsupported 1096 raise error.WdirUnsupported
1096 return None 1097 return None
1097 except TypeError: 1098 except (TypeError, binascii.Error):
1098 pass 1099 pass
1099 1100
1100 def lookup(self, id): 1101 def lookup(self, id):
1101 """locate a node based on: 1102 """locate a node based on:
1102 - revision number or str(revision number) 1103 - revision number or str(revision number)