mercurial/utils/hashutil.py
author Yuya Nishihara <yuya@tcha.org>
Mon, 07 Dec 2020 20:12:36 +0900
changeset 46065 56a5ea353182
parent 44059 7126d8b8e0e6
child 46785 521ac0d7047f
permissions -rw-r--r--
test-extension: flush diagnostic message to stabilize chg output Since chg server may create new file object for the attached stdout, procutil.stdout is not ui.fout and the buffered procutil.stdout data wouldn't be flushed at all. That's why test-extension.t passes without modification on Python 2.

from __future__ import absolute_import

import hashlib

try:
    from ..thirdparty import sha1dc

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