diff mercurial/util.py @ 35582:72b91f905065

py3: use node.hex(h.digest()) instead of h.hexdigest() hashlib.sha1.hexdigest() returns str on Python 3. Differential Revision: https://phab.mercurial-scm.org/D1792
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 29 Dec 2017 05:25:27 +0530
parents c4caf530b1c7
children fb0be099063f
line wrap: on
line diff
--- a/mercurial/util.py	Fri Dec 29 05:22:06 2017 +0530
+++ b/mercurial/util.py	Fri Dec 29 05:25:27 2017 +0530
@@ -49,6 +49,7 @@
     encoding,
     error,
     i18n,
+    node as nodemod,
     policy,
     pycompat,
     urllibcompat,
@@ -265,7 +266,7 @@
     def __getitem__(self, key):
         if key not in DIGESTS:
             raise Abort(_('unknown digest type: %s') % k)
-        return self._hashes[key].hexdigest()
+        return nodemod.hex(self._hashes[key].digest())
 
     def __iter__(self):
         return iter(self._hashes)