def hgopen(args, cwd=None):
    """Call Git with arguments."""

    returncode = None
    output = None

    cmd = [_hg_path] + args

    env = environ.copy()
    env['LC_ALL'] = 'en_US'

    if _PLATFORM == "windows":
        startupinfo = subprocess.STARTUPINFO()
        startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
        process = subprocess.Popen(
            cmd,
            startupinfo=startupinfo,
            stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT,
            stdin=subprocess.PIPE,
            cwd=cwd,
            shell=False,
            env=env
        )
    else:
        process = subprocess.Popen(
            cmd,
            stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT,
            stdin=subprocess.PIPE,
            cwd=cwd,
            shell=False,
            env=env
        )
    output = process.communicate()
    returncode = process.returncode

    assert returncode == 0, (output[0].rstrip(), str(cmd)) % "Runtime Error: %s\n%s"

    return output[0]
dataset/ETHPy150Open facelessuser/EasyDiff/lib/hg.py/hgopen/swapped operands of `%`