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

Method load_macros

Tools/c-analyzer/distutils/msvc9compiler.py:129–158  ·  view source on GitHub ↗
(self, version)

Source from the content-addressed store, hash-verified

127 self.macros["$(%s)" % macro] = Reg.get_value(path, key)
128
129 def load_macros(self, version):
130 self.set_macro("VCInstallDir", self.vsbase + r"\Setup\VC", "productdir")
131 self.set_macro("VSInstallDir", self.vsbase + r"\Setup\VS", "productdir")
132 self.set_macro("FrameworkDir", NET_BASE, "installroot")
133 try:
134 if version >= 8.0:
135 self.set_macro("FrameworkSDKDir", NET_BASE,
136 "sdkinstallrootv2.0")
137 else:
138 raise KeyError("sdkinstallrootv2.0")
139 except KeyError:
140 raise DistutilsPlatformError(
141 """Python was built with Visual Studio 2008;
142extensions must be built with a compiler than can generate compatible binaries.
143Visual Studio 2008 was not found on this system. If you have Cygwin installed,
144you can try compiling with MingW32, by passing "-c mingw32" to setup.py.""")
145
146 if version >= 9.0:
147 self.set_macro("FrameworkVersion", self.vsbase, "clr version")
148 self.set_macro("WindowsSdkDir", WINSDK_BASE, "currentinstallfolder")
149 else:
150 p = r"Software\Microsoft\NET Framework Setup\Product"
151 for base in HKEYS:
152 try:
153 h = RegOpenKeyEx(base, p)
154 except RegError:
155 continue
156 key = RegEnumKey(h, 0)
157 d = Reg.get_value(base, r"%s\%s" % (p, key))
158 self.macros["$(FrameworkVersion)"] = d["version"]
159
160 def sub(self, s):
161 for k, v in self.macros.items():

Callers 1

__init__Method · 0.95

Calls 3

set_macroMethod · 0.95
get_valueMethod · 0.45

Tested by

no test coverage detected