当前位置: 首页>>代码示例>>Python>>正文


Python msvc9compiler.query_vcvarsall方法代码示例

本文整理汇总了Python中distutils.msvc9compiler.query_vcvarsall方法的典型用法代码示例。如果您正苦于以下问题:Python msvc9compiler.query_vcvarsall方法的具体用法?Python msvc9compiler.query_vcvarsall怎么用?Python msvc9compiler.query_vcvarsall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在distutils.msvc9compiler的用法示例。


在下文中一共展示了msvc9compiler.query_vcvarsall方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_no_compiler

# 需要导入模块: from distutils import msvc9compiler [as 别名]
# 或者: from distutils.msvc9compiler import query_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 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:18,代码来源:test_msvc9compiler.py

示例2: test_no_compiler

# 需要导入模块: from distutils import msvc9compiler [as 别名]
# 或者: from distutils.msvc9compiler import query_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 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:18,代码来源:test_msvc9compiler.py

示例3: patch_for_msvc_specialized_compiler

# 需要导入模块: from distutils import msvc9compiler [as 别名]
# 或者: from distutils.msvc9compiler import query_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 
开发者ID:awemulya,项目名称:kobo-predict,代码行数:51,代码来源:monkey.py


注:本文中的distutils.msvc9compiler.query_vcvarsall方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。