差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン 次のリビジョン両方とも次のリビジョン | ||
python:wxpython [2020/03/09 09:15] – [distutils.msvccompiler の get_build_version() の実装 (Python 3.8)] ともやん | python:wxpython [2020/03/09 09:20] – [distutils.msvccompiler の get_build_version() の実装 (Python 3.8)] ともやん | ||
---|---|---|---|
行 235: | 行 235: | ||
<WRAP prewrap 100% #result> | <WRAP prewrap 100% #result> | ||
<code python> | <code python> | ||
+ | >>> | ||
+ | >>> | ||
+ | 14.1 | ||
>>> | >>> | ||
>>> | >>> | ||
行 254: | 行 257: | ||
</ | </ | ||
- | ==== distutils.msvc9compiler の ==== | + | ==== distutils.msvc9compiler の find_vcvarsall() の実装 (Python 3.8) ==== |
<WRAP prewrap 100% #result> | <WRAP prewrap 100% #result> | ||
<code python> | <code python> | ||
+ | def find_vcvarsall(version): | ||
+ | """ | ||
+ | |||
+ | At first it tries to find the productdir of VS 2008 in the registry. If | ||
+ | that fails it falls back to the VS90COMNTOOLS env var. | ||
+ | """ | ||
+ | vsbase = VS_BASE % version | ||
+ | try: | ||
+ | productdir = Reg.get_value(r" | ||
+ | " | ||
+ | except KeyError: | ||
+ | log.debug(" | ||
+ | productdir = None | ||
+ | |||
+ | if not productdir or not os.path.isdir(productdir): | ||
+ | toolskey = " | ||
+ | toolsdir = os.environ.get(toolskey, | ||
+ | |||
+ | if toolsdir and os.path.isdir(toolsdir): | ||
+ | productdir = os.path.join(toolsdir, | ||
+ | productdir = os.path.abspath(productdir) | ||
+ | if not os.path.isdir(productdir): | ||
+ | log.debug(" | ||
+ | return None | ||
+ | else: | ||
+ | log.debug(" | ||
+ | if not productdir: | ||
+ | log.debug(" | ||
+ | return None | ||
+ | vcvarsall = os.path.join(productdir, | ||
+ | if os.path.isfile(vcvarsall): | ||
+ | return vcvarsall | ||
+ | log.debug(" | ||
+ | return None | ||
</ | </ | ||
</ | </ |