mercurial/utils/hashutil.py
author Matt Harbison <matt_harbison@yahoo.com>
Thu, 06 May 2021 18:40:23 -0400
branchstable
changeset 47039 94c0c36299b1
parent 46413 521ac0d7047f
child 48966 6000f5b25c9b
permissions -rw-r--r--
hghave: fix the definition of `python3` to work on Windows Both py2 and py3 executables are named `python.exe`, and may or may not be on PATH. So use the dispatcher executable that comes with py3 to fetch the version of the latest py3 executable. This allows at least one relnotes test to run on Windows. Differential Revision: https://phab.mercurial-scm.org/D10694

from __future__ import absolute_import

import hashlib

try:
    from ..thirdparty import sha1dc  # pytype: disable=import-error

    sha1 = sha1dc.sha1
except (ImportError, AttributeError):
    sha1 = hashlib.sha1