def zsh_version():
    """Try to guess zsh version, return (0, 0) on failure."""
    try:
        out = subprocess.check_output(shlex.split('zsh --version'))
    except (FileNotFoundError, subprocess.CalledProcessError):
        return (0, 0)
    match = re.search(br'[0-9]+\.[0-9]+', out)
    return tuple(map(int, match.group(0).split(b'.'))) if match else (0, 0)
Try to guess zsh version, return (0, 0) on failure.