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


Python sysconfig.get_config_vars方法代码示例

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


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

示例1: expanduser

# 需要导入模块: import sysconfig [as 别名]
# 或者: from sysconfig import get_config_vars [as 别名]
def expanduser(path):
    """
    Expand ~ and ~user constructions.

    Includes a workaround for http://bugs.python.org/issue14768
    """
    expanded = os.path.expanduser(path)
    if path.startswith('~/') and expanded.startswith('//'):
        expanded = expanded[1:]
    return expanded


# packages in the stdlib that may have installation metadata, but should not be
# considered 'installed'.  this theoretically could be determined based on
# dist.location (py27:`sysconfig.get_paths()['stdlib']`,
# py26:sysconfig.get_config_vars('LIBDEST')), but fear platform variation may
# make this ineffective, so hard-coding 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:19,代码来源:__init__.py

示例2: test_version_int

# 需要导入模块: import sysconfig [as 别名]
# 或者: from sysconfig import get_config_vars [as 别名]
def test_version_int(self):
        source = self.mkdtemp()
        target = self.mkdtemp()
        expected = self.write_sample_scripts(source)


        cmd = self.get_build_scripts_cmd(target,
                                         [os.path.join(source, fn)
                                          for fn in expected])
        cmd.finalize_options()

        # http://bugs.python.org/issue4524
        #
        # On linux-g++-32 with command line `./configure --enable-ipv6
        # --with-suffix=3`, python is compiled okay but the build scripts
        # failed when writing the name of the executable
        old = sysconfig.get_config_vars().get('VERSION')
        sysconfig._CONFIG_VARS['VERSION'] = 4
        try:
            cmd.run()
        finally:
            if old is not None:
                sysconfig._CONFIG_VARS['VERSION'] = old

        built = os.listdir(target)
        for name in expected:
            self.assertIn(name, built) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:29,代码来源:test_build_scripts.py

示例3: python_is_optimized

# 需要导入模块: import sysconfig [as 别名]
# 或者: from sysconfig import get_config_vars [as 别名]
def python_is_optimized():
    cflags = sysconfig.get_config_vars()['PY_CFLAGS']
    final_opt = ""
    for opt in cflags.split():
        if opt.startswith('-O'):
            final_opt = opt
    return final_opt not in ('', '-O0', '-Og') 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:9,代码来源:test_gdb.py

示例4: python_is_optimized

# 需要导入模块: import sysconfig [as 别名]
# 或者: from sysconfig import get_config_vars [as 别名]
def python_is_optimized():
    cflags = sysconfig.get_config_vars()['PY_CFLAGS']
    final_opt = ""
    for opt in cflags.split():
        if opt.startswith('-O'):
            final_opt = opt
    return (final_opt and final_opt != '-O0') 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:9,代码来源:test_gdb.py

示例5: test_version_int

# 需要导入模块: import sysconfig [as 别名]
# 或者: from sysconfig import get_config_vars [as 别名]
def test_version_int(self):
        source = self.mkdtemp()
        target = self.mkdtemp()
        expected = self.write_sample_scripts(source)


        cmd = self.get_build_scripts_cmd(target,
                                         [os.path.join(source, fn)
                                          for fn in expected])
        cmd.finalize_options()

        # http://bugs.python.org/issue4524
        #
        # On linux-g++-32 with command line `./configure --enable-ipv6
        # --with-suffix=3`, python is compiled okay but the build scripts
        # failed when writing the name of the executable
        old = sysconfig.get_config_vars().get('VERSION')
        sysconfig._CONFIG_VARS['VERSION'] = 4
        try:
            cmd.run()
        finally:
            if old is not None:
                sysconfig._CONFIG_VARS['VERSION'] = old

        built = os.listdir(target)
        for name in expected:
            self.assertTrue(name in built) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:29,代码来源:test_build_scripts.py

示例6: test_get_config_vars

# 需要导入模块: import sysconfig [as 别名]
# 或者: from sysconfig import get_config_vars [as 别名]
def test_get_config_vars(self):
        cvars = get_config_vars()
        self.assertIsInstance(cvars, dict)
        self.assertTrue(cvars) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:6,代码来源:test_sysconfig.py

示例7: test_SO_in_vars

# 需要导入模块: import sysconfig [as 别名]
# 或者: from sysconfig import get_config_vars [as 别名]
def test_SO_in_vars(self):
        vars = sysconfig.get_config_vars()
        self.assertIsNotNone(vars['SO'])
        self.assertEqual(vars['SO'], vars['EXT_SUFFIX']) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:6,代码来源:test_sysconfig.py

示例8: test_sysconfig

# 需要导入模块: import sysconfig [as 别名]
# 或者: from sysconfig import get_config_vars [as 别名]
def test_sysconfig(self):
        import distutils.sysconfig
        import sysconfig
        ldlibrary = "libpython{}.{}{}.so".format(*sys.version_info[:2], ABI_FLAGS)
        self.assertEqual(ldlibrary, sysconfig.get_config_vars()["LDLIBRARY"])
        self.assertEqual(ldlibrary, distutils.sysconfig.get_config_vars()["LDLIBRARY"]) 
开发者ID:chaquo,项目名称:chaquopy,代码行数:8,代码来源:test_android.py


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