def find_vc_pdir_vswhere(msvc_version):
    """
    Find the MSVC product directory using the vswhere program.

    :param msvc_version: MSVC version to search for
    :return: MSVC install dir or None
    :raises UnsupportedVersion: if the version is not known by this file
    """

    try:
        vswhere_version = _VCVER_TO_VSWHERE_VER[msvc_version]
    except KeyError:
        debug("Unknown version of MSVC: %s" % msvc_version)
        raise UnsupportedVersion("Unknown version %s" % msvc_version)

    # For bug 3333 - support default location of vswhere for both 64 and 32 bit windows
    # installs.
    for pf in ['Program Files (x86)', 'Program Files']:
        vswhere_path = os.path.join(
            'C:\\',
            pf,
            'Microsoft Visual Studio',
            'Installer',
            'vswhere.exe'
        )
        if os.path.exists(vswhere_path):
            # If we found vswhere, then use it.
            break
    else:
        # No vswhere on system, no install info available
        return None

    vswhere_cmd = [vswhere_path,
                   '-products', '*',
                   '-version', vswhere_version,
                   '-property', 'installationPath']

    #TODO PY27 cannot use Popen as context manager
    # try putting it back to the old way for now
    sp = subprocess.Popen(vswhere_cmd,
                          stdout=subprocess.PIPE,
                          stderr=subprocess.PIPE)
    vsdir, err = sp.communicate()
    if vsdir:
        vsdir = vsdir.decode("mbcs").splitlines()
        # vswhere could easily return multiple lines
        # we could define a way to pick the one we prefer, but since
        # this data is currently only used to make a check for existence,
        # returning the first hit should be good enough for now.
        vc_pdir = os.path.join(vsdir[0], 'VC')
        return vc_pdir
    else:
        # No vswhere on system, no install info available
        return None