MCPcopy Index your code
hub / github.com/python/cpython / get_msvc_paths

Method get_msvc_paths

Tools/c-analyzer/distutils/msvccompiler.py:271–305  ·  view source on GitHub ↗

Get a list of devstudio directories (include, lib or path). Return a list of strings. The list will be empty if unable to access the registry or appropriate registry keys not found.

(self, path, platform='x86')

Source from the content-addressed store, hash-verified

269 return exe
270
271 def get_msvc_paths(self, path, platform='x86'):
272 """Get a list of devstudio directories (include, lib or path).
273
274 Return a list of strings. The list will be empty if unable to
275 access the registry or appropriate registry keys not found.
276 """
277 if not _can_read_reg:
278 return []
279
280 path = path + " dirs"
281 if self.__version >= 7:
282 key = (r"%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories"
283 % (self.__root, self.__version))
284 else:
285 key = (r"%s\6.0\Build System\Components\Platforms"
286 r"\Win32 (%s)\Directories" % (self.__root, platform))
287
288 for base in HKEYS:
289 d = read_values(base, key)
290 if d:
291 if self.__version >= 7:
292 return self.__macros.sub(d[path]).split(";")
293 else:
294 return d[path].split(";")
295 # MSVC 6 seems to create the registry entries we need only when
296 # the GUI is run.
297 if self.__version == 6:
298 for base in HKEYS:
299 if read_values(base, r"%s\6.0" % self.__root) is not None:
300 self.warn("It seems you have Visual Studio 6 installed, "
301 "but the expected registry settings are not present.\n"
302 "You must at least run the Visual Studio GUI once "
303 "so that these entries are created.")
304 break
305 return []
306
307 def set_path_env_var(self, name):
308 """Set environment variable 'name' to an MSVC path type value.

Callers 1

set_path_env_varMethod · 0.95

Calls 4

read_valuesFunction · 0.85
splitMethod · 0.45
subMethod · 0.45
warnMethod · 0.45

Tested by

no test coverage detected