本文整理匯總了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