本文整理汇总了Python中distutils.msvc9compiler.find_vcvarsall方法的典型用法代码示例。如果您正苦于以下问题:Python msvc9compiler.find_vcvarsall方法的具体用法?Python msvc9compiler.find_vcvarsall怎么用?Python msvc9compiler.find_vcvarsall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类distutils.msvc9compiler
的用法示例。
在下文中一共展示了msvc9compiler.find_vcvarsall方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_no_compiler
# 需要导入模块: from distutils import msvc9compiler [as 别名]
# 或者: from distutils.msvc9compiler import find_vcvarsall [as 别名]
def test_no_compiler(self):
# makes sure query_vcvarsall raises
# a DistutilsPlatformError if the compiler
# is not found
from distutils.msvc9compiler import query_vcvarsall
def _find_vcvarsall(version):
return None
from distutils import msvc9compiler
old_find_vcvarsall = msvc9compiler.find_vcvarsall
msvc9compiler.find_vcvarsall = _find_vcvarsall
try:
self.assertRaises(DistutilsPlatformError, query_vcvarsall,
'wont find this version')
finally:
msvc9compiler.find_vcvarsall = old_find_vcvarsall
示例2: test_no_compiler
# 需要导入模块: from distutils import msvc9compiler [as 别名]
# 或者: from distutils.msvc9compiler import find_vcvarsall [as 别名]
def test_no_compiler(self):
# makes sure query_vcvarsall throws
# a DistutilsPlatformError if the compiler
# is not found
from distutils.msvc9compiler import query_vcvarsall
def _find_vcvarsall(version):
return None
from distutils import msvc9compiler
old_find_vcvarsall = msvc9compiler.find_vcvarsall
msvc9compiler.find_vcvarsall = _find_vcvarsall
try:
self.assertRaises(DistutilsPlatformError, query_vcvarsall,
'wont find this version')
finally:
msvc9compiler.find_vcvarsall = old_find_vcvarsall
示例3: patch_for_msvc_specialized_compiler
# 需要导入模块: from distutils import msvc9compiler [as 别名]
# 或者: from distutils.msvc9compiler import find_vcvarsall [as 别名]
def patch_for_msvc_specialized_compiler():
"""
Patch functions in distutils to use standalone Microsoft Visual C++
compilers.
"""
from . import msvc
try:
# Distutil file for MSVC++ 9.0 and upper (Python 2.7 to 3.4)
import distutils.msvc9compiler as msvc9compiler
except ImportError:
pass
try:
# Distutil file for MSVC++ 14.0 and upper (Python 3.5+)
import distutils._msvccompiler as msvc14compiler
except ImportError:
pass
if platform.system() != 'Windows':
# Compilers only availables on Microsoft Windows
return
if unpatched:
# Already patched
return
try:
# Patch distutils.msvc9compiler
unpatched['msvc9_find_vcvarsall'] = msvc9compiler.find_vcvarsall
msvc9compiler.find_vcvarsall = msvc.msvc9_find_vcvarsall
unpatched['msvc9_query_vcvarsall'] = msvc9compiler.query_vcvarsall
msvc9compiler.query_vcvarsall = msvc.msvc9_query_vcvarsall
except NameError:
pass
try:
# Patch distutils._msvccompiler._get_vc_env
unpatched['msvc14_get_vc_env'] = msvc14compiler._get_vc_env
msvc14compiler._get_vc_env = msvc.msvc14_get_vc_env
except NameError:
pass
try:
# Patch distutils._msvccompiler.gen_lib_options for Numpy
unpatched['msvc14_gen_lib_options'] = msvc14compiler.gen_lib_options
msvc14compiler.gen_lib_options = msvc.msvc14_gen_lib_options
except NameError:
pass