當前位置: 首頁>>代碼示例>>Python>>正文


Python sys.abiflags方法代碼示例

本文整理匯總了Python中sys.abiflags方法的典型用法代碼示例。如果您正苦於以下問題:Python sys.abiflags方法的具體用法?Python sys.abiflags怎麽用?Python sys.abiflags使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sys的用法示例。


在下文中一共展示了sys.abiflags方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_sys

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import abiflags [as 別名]
def test_sys(self):
        self.assertEqual(ABI_FLAGS, sys.abiflags)
        self.assertEqual([""], sys.argv)
        self.assertTrue(exists(sys.executable), sys.executable)
        self.assertEqual("siphash24", sys.hash_info.algorithm)

        chaquopy_dir = f"{context.getFilesDir()}/chaquopy"
        self.assertEqual([join(chaquopy_dir, path) for path in
                          ["AssetFinder/app", "AssetFinder/requirements",
                           f"AssetFinder/stdlib-{ABI}", "stdlib-common.imy",
                           "bootstrap.imy", f"bootstrap-native/{ABI}"]],
                         sys.path)
        for p in sys.path:
            self.assertTrue(exists(p), p)

        self.assertRegex(sys.platform, r"^linux")
        self.assertRegex(sys.version,  # Make sure we don't have any "-dirty" caption.
                         r"^{}.{}.{} \(default, ".format(*sys.version_info[:3])) 
開發者ID:chaquo,項目名稱:chaquopy,代碼行數:20,代碼來源:test_android.py

示例2: _init_posix

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import abiflags [as 別名]
def _init_posix():
    """Initialize the module as appropriate for POSIX systems."""
    # _sysconfigdata is generated at build time, see the sysconfig module
    name = os.environ.get('_PYTHON_SYSCONFIGDATA_NAME',
        '_sysconfigdata_{abi}_{platform}_{multiarch}'.format(
        abi=sys.abiflags,
        platform=sys.platform,
        multiarch=getattr(sys.implementation, '_multiarch', ''),
    ))
    try:
        _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
    except ImportError:
        # Python 3.5 and pypy 7.3.1
        _temp = __import__(
            '_sysconfigdata', globals(), locals(), ['build_time_vars'], 0)
    build_time_vars = _temp.build_time_vars
    global _config_vars
    _config_vars = {}
    _config_vars.update(build_time_vars) 
開發者ID:pypa,項目名稱:setuptools,代碼行數:21,代碼來源:sysconfig.py

示例3: _set_py_limited_api

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import abiflags [as 別名]
def _set_py_limited_api(Extension, kwds):
    """
    Add py_limited_api to kwds if setuptools >= 26 is in use.
    Do not alter the setting if it already exists.
    Setuptools takes care of ignoring the flag on Python 2 and PyPy.

    CPython itself should ignore the flag in a debugging version
    (by not listing .abi3.so in the extensions it supports), but
    it doesn't so far, creating troubles.  That's why we check
    for "not hasattr(sys, 'gettotalrefcount')" (the 2.7 compatible equivalent
    of 'd' not in sys.abiflags). (http://bugs.python.org/issue28401)
    """
    if 'py_limited_api' not in kwds and not hasattr(sys, 'gettotalrefcount'):
        import setuptools
        try:
            setuptools_major_version = int(setuptools.__version__.partition('.')[0])
            if setuptools_major_version >= 26:
                kwds['py_limited_api'] = True
        except ValueError:  # certain development versions of setuptools
            # If we don't know the version number of setuptools, we
            # try to set 'py_limited_api' anyway.  At worst, we get a
            # warning.
            kwds['py_limited_api'] = True
    return kwds 
開發者ID:aws-quickstart,項目名稱:quickstart-git2s3,代碼行數:26,代碼來源:setuptools_ext.py

示例4: get_makefile_filename

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import abiflags [as 別名]
def get_makefile_filename():
    """Return the path of the Makefile."""
    if _PYTHON_BUILD:
        return os.path.join(_PROJECT_BASE, "Makefile")
    if hasattr(sys, 'abiflags'):
        config_dir_name = 'config-%s%s' % (_PY_VERSION_SHORT, sys.abiflags)
    else:
        config_dir_name = 'config'
    return os.path.join(get_path('stdlib'), config_dir_name, 'Makefile') 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:11,代碼來源:sysconfig.py

示例5: _set_py_limited_api

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import abiflags [as 別名]
def _set_py_limited_api(Extension, kwds):
    """
    Add py_limited_api to kwds if setuptools >= 26 is in use.
    Do not alter the setting if it already exists.
    Setuptools takes care of ignoring the flag on Python 2 and PyPy.

    CPython itself should ignore the flag in a debugging version
    (by not listing .abi3.so in the extensions it supports), but
    it doesn't so far, creating troubles.  That's why we check
    for "not hasattr(sys, 'gettotalrefcount')" (the 2.7 compatible equivalent
    of 'd' not in sys.abiflags). (http://bugs.python.org/issue28401)

    On Windows, it's better not to use py_limited_api until issue #355
    can be resolved (by having virtualenv copy PYTHON3.DLL).  See also
    the start of _cffi_include.h.
    """
    if ('py_limited_api' not in kwds and not hasattr(sys, 'gettotalrefcount')
            and sys.platform != 'win32'):
        import setuptools
        try:
            setuptools_major_version = int(setuptools.__version__.partition('.')[0])
            if setuptools_major_version >= 26:
                kwds['py_limited_api'] = True
        except ValueError:  # certain development versions of setuptools
            # If we don't know the version number of setuptools, we
            # try to set 'py_limited_api' anyway.  At worst, we get a
            # warning.
            kwds['py_limited_api'] = True
    return kwds 
開發者ID:reBiocoder,項目名稱:bioforum,代碼行數:31,代碼來源:setuptools_ext.py

示例6: _set_py_limited_api

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import abiflags [as 別名]
def _set_py_limited_api(Extension, kwds):
    """
    Add py_limited_api to kwds if setuptools >= 26 is in use.
    Do not alter the setting if it already exists.
    Setuptools takes care of ignoring the flag on Python 2 and PyPy.

    CPython itself should ignore the flag in a debugging version
    (by not listing .abi3.so in the extensions it supports), but
    it doesn't so far, creating troubles.  That's why we check
    for "not hasattr(sys, 'gettotalrefcount')" (the 2.7 compatible equivalent
    of 'd' not in sys.abiflags). (http://bugs.python.org/issue28401)

    On Windows, with CPython <= 3.4, it's better not to use py_limited_api
    because virtualenv *still* doesn't copy PYTHON3.DLL on these versions.
    For now we'll skip py_limited_api on all Windows versions to avoid an
    inconsistent mess.
    """
    if ('py_limited_api' not in kwds and not hasattr(sys, 'gettotalrefcount')
            and sys.platform != 'win32'):
        import setuptools
        try:
            setuptools_major_version = int(setuptools.__version__.partition('.')[0])
            if setuptools_major_version >= 26:
                kwds['py_limited_api'] = True
        except ValueError:  # certain development versions of setuptools
            # If we don't know the version number of setuptools, we
            # try to set 'py_limited_api' anyway.  At worst, we get a
            # warning.
            kwds['py_limited_api'] = True
    return kwds 
開發者ID:tp4a,項目名稱:teleport,代碼行數:32,代碼來源:setuptools_ext.py

示例7: get_makefile_filename

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import abiflags [as 別名]
def get_makefile_filename():
    """Return the path of the Makefile."""
    if _PYTHON_BUILD:
        return os.path.join(_sys_home or _PROJECT_BASE, "Makefile")
    if hasattr(sys, 'abiflags'):
        config_dir_name = 'config-%s%s' % (_PY_VERSION_SHORT, sys.abiflags)
    else:
        config_dir_name = 'config'
    return os.path.join(get_path('stdlib'), config_dir_name, 'Makefile') 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:11,代碼來源:sysconfig.py

示例8: get_makefile_filename

# 需要導入模塊: import sys [as 別名]
# 或者: from sys import abiflags [as 別名]
def get_makefile_filename():
    """Return the path of the Makefile."""
    if _PYTHON_BUILD:
        return os.path.join(_sys_home or _PROJECT_BASE, "Makefile")
    if hasattr(sys, 'abiflags'):
        config_dir_name = 'config-%s%s' % (_PY_VERSION_SHORT, sys.abiflags)
    else:
        config_dir_name = 'config'
    if hasattr(sys.implementation, '_multiarch'):
        config_dir_name += '-%s' % sys.implementation._multiarch
    return os.path.join(get_path('stdlib'), config_dir_name, 'Makefile') 
開發者ID:CedricGuillemet,項目名稱:Imogen,代碼行數:13,代碼來源:sysconfig.py


注:本文中的sys.abiflags方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。