parameters: (env, msvc_version)
return_statement: return None
docstring: Find the MSVC product directory for the given version.
  
      Tries to look up the path using a registry key from the table
      _VCVER_TO_PRODUCT_DIR; if there is no key, calls find_vc_pdir_wshere
      for help instead.
  
      Args:
          msvc_version: str
              msvc version (major.minor, e.g. 10.0)
  
      Returns:
          str: Path found in registry, or None
  
      Raises:
          UnsupportedVersion: if the version is not known by this file.
          MissingConfiguration: found version but the directory is missing.
  
          Both exceptions inherit from VisualCException.
docstring_summary: Find the MSVC product directory for the given version.
docstring_tokens: Find the MSVC product directory for the given version .
function: def find_vc_pdir(env, msvc_version):
      """Find the MSVC product directory for the given version.
  
      Tries to look up the path using a registry key from the table
      _VCVER_TO_PRODUCT_DIR; if there is no key, calls find_vc_pdir_wshere
      for help instead.
  
      Args:
          msvc_version: str
              msvc version (major.minor, e.g. 10.0)
  
      Returns:
          str: Path found in registry, or None
  
      Raises:
          UnsupportedVersion: if the version is not known by this file.
          MissingConfiguration: found version but the directory is missing.
  
          Both exceptions inherit from VisualCException.
  
      """
      root = 'Software\\'
      try:
          hkeys = _VCVER_TO_PRODUCT_DIR[msvc_version]
      except KeyError:
          debug("Unknown version of MSVC: %s" % msvc_version)
          raise UnsupportedVersion("Unknown version %s" % msvc_version)
  
      for hkroot, key in hkeys:
          try:
              comps = None
              if not key:
                  comps = find_vc_pdir_vswhere(msvc_version, env)
                  if not comps:
                      debug('no VC found for version {}'.format(repr(msvc_version)))
                      raise SCons.Util.WinError
                  debug('VC found: {}'.format(repr(msvc_version)))
                  return comps
              else:
                  if common.is_win64():
                      try:
                          # ordinarily at win64, try Wow6432Node first.
                          comps = common.read_reg(root + 'Wow6432Node\\' + key, hkroot)
                      except SCons.Util.WinError as e:
                          # at Microsoft Visual Studio for Python 2.7, value is not in Wow6432Node
                          pass
                  if not comps:
                      # not Win64, or Microsoft Visual Studio for Python 2.7
                      comps = common.read_reg(root + key, hkroot)
          except SCons.Util.WinError as e:
              debug('no VC registry key {}'.format(repr(key)))
          else:
              debug('found VC in registry: {}'.format(comps))
              if os.path.exists(comps):
                  return comps
              else:
                  debug('reg says dir is {}, but it does not exist. (ignoring)'.format(comps))
                  raise MissingConfiguration("registry dir {} not found on the filesystem".format(comps))
      return None
function_tokens: def find_vc_pdir ( env , msvc_version ) : root = 'Software\\' try : hkeys = _VCVER_TO_PRODUCT_DIR [ msvc_version ] except KeyError : debug ( "Unknown version of MSVC: %s" % msvc_version ) raise UnsupportedVersion ( "Unknown version %s" % msvc_version ) for hkroot , key in hkeys : try : comps = None if not key : comps = find_vc_pdir_vswhere ( msvc_version , env ) if not comps : debug ( 'no VC found for version {}' . format ( repr ( msvc_version ) ) ) raise SCons . Util . WinError debug ( 'VC found: {}' . format ( repr ( msvc_version ) ) ) return comps else : if common . is_win64 ( ) : try : # ordinarily at win64, try Wow6432Node first. comps = common . read_reg ( root + 'Wow6432Node\\' + key , hkroot ) except SCons . Util . WinError as e : # at Microsoft Visual Studio for Python 2.7, value is not in Wow6432Node pass if not comps : # not Win64, or Microsoft Visual Studio for Python 2.7 comps = common . read_reg ( root + key , hkroot ) except SCons . Util . WinError as e : debug ( 'no VC registry key {}' . format ( repr ( key ) ) ) else : debug ( 'found VC in registry: {}' . format ( comps ) ) if os . path . exists ( comps ) : return comps else : debug ( 'reg says dir is {}, but it does not exist. (ignoring)' . format ( comps ) ) raise MissingConfiguration ( "registry dir {} not found on the filesystem" . format ( comps ) ) return None