def python_version(path_to_python):
    if (not path_to_python):
        return None
    try:
        c = delegator.run([path_to_python, '--version'], block=False)
    except Exception:
        return None
    c.block()
    version = parse_python_version((c.out.strip() or c.err.strip()))
    try:
        version = u'{major}.{minor}.{micro}'.format(**version)
    except TypeError:
        return None
    return version
def python_version(path_to_python):
    if (not path_to_python):
        return None
    try:
        c = delegator.run([path_to_python, '--version'], block=False)
    except Exception:
        return None
    c.block()
    version = parse_python_version((c.out.strip() or c.err.strip()))
    try:
        version = u'{major}.{minor}.{micro}'.format(**version)
    except TypeError:
        return None
    return version