1762 localHg = os.path.join(sys.exec_prefix, "Scripts", "hg.exe") |
1762 localHg = os.path.join(sys.exec_prefix, "Scripts", "hg.exe") |
1763 else: |
1763 else: |
1764 localHg = os.path.join(sys.exec_prefix, "bin", "hg") |
1764 localHg = os.path.join(sys.exec_prefix, "bin", "hg") |
1765 for hg in (localHg, "hg"): |
1765 for hg in (localHg, "hg"): |
1766 with contextlib.suppress(OSError, subprocess.CalledProcessError): |
1766 with contextlib.suppress(OSError, subprocess.CalledProcessError): |
1767 hgOut = subprocess.check_output(["hg", "identify", "-i"]) # secok |
1767 hgOut = subprocess.check_output([hg, "identify", "-i"]) # secok |
1768 hgOut = hgOut.decode() |
1768 hgOut = hgOut.decode() |
1769 if hgOut: |
1769 if hgOut: |
1770 break |
1770 break |
1771 else: |
1771 else: |
1772 hgOut = "" |
1772 hgOut = "" |