parameters: ()
return_statement: return best_version, best_dir
docstring: Python 3.8 "distutils/_msvccompiler.py" backport
docstring_summary: Python 3.8 "distutils/_msvccompiler.py" backport
docstring_tokens: Python 3 . 8 distutils / _msvccompiler . py backport
function: def _msvc14_find_vc2015():
      """Python 3.8 "distutils/_msvccompiler.py" backport"""
      try:
          key = winreg.OpenKey(
              winreg.HKEY_LOCAL_MACHINE,
              r"Software\Microsoft\VisualStudio\SxS\VC7",
              0,
              winreg.KEY_READ | winreg.KEY_WOW64_32KEY
          )
      except OSError:
          return None, None
  
      best_version = 0
      best_dir = None
      with key:
          for i in itertools.count():
              try:
                  v, vc_dir, vt = winreg.EnumValue(key, i)
              except OSError:
                  break
              if v and vt == winreg.REG_SZ and isdir(vc_dir):
                  try:
                      version = int(float(v))
                  except (ValueError, TypeError):
                      continue
                  if version >= 14 and version > best_version:
                      best_version, best_dir = version, vc_dir
      return best_version, best_dir
function_tokens: def _msvc14_find_vc2015 ( ) : try : key = winreg . OpenKey ( winreg . HKEY_LOCAL_MACHINE , r"Software\Microsoft\VisualStudio\SxS\VC7" , 0 , winreg . KEY_READ | winreg . KEY_WOW64_32KEY ) except OSError : return None , None best_version = 0 best_dir = None with key : for i in itertools . count ( ) : try : v , vc_dir , vt = winreg . EnumValue ( key , i ) except OSError : break if v and vt == winreg . REG_SZ and isdir ( vc_dir ) : try : version = int ( float ( v ) ) except ( ValueError , TypeError ) : continue if version >= 14 and version > best_version : best_version , best_dir = version , vc_dir return best_version , best_dir