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


Python version_info.minor方法代码示例

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


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

示例1: _verify_python_version

# 需要导入模块: from sys import version_info [as 别名]
# 或者: from sys.version_info import minor [as 别名]
def _verify_python_version(self, key, cafile, capath, cahostverify):
        python_version_cur = ".".join([str(version_info.major),
                                       str(version_info.minor),
                                       str(version_info.micro)])
        python_version_min = "2.7.9"
        if StrictVersion(python_version_cur) < StrictVersion(python_version_min):
            if cafile or capath:
                raise AnsibleError('Unable to read %s from vault:'
                                   ' Using Python %s, and vault lookup plugin requires at least %s'
                                   ' to use an SSL context (VAULT_CACERT or VAULT_CAPATH)'
                                   % (key, python_version_cur, python_version_min))
            elif cahostverify:
                raise AnsibleError('Unable to read %s from vault:'
                                   ' Using Python %s, and vault lookup plugin requires at least %s'
                                   ' to verify Vault certificate. (set VAULT_CAHOSTVERIFY to \'%s\''
                                   ' to disable certificate verification.)'
                                   % (key, python_version_cur, python_version_min, DISABLE_VAULT_CAHOSTVERIFY)) 
开发者ID:jhaals,项目名称:ansible-vault,代码行数:19,代码来源:vault.py

示例2: _cli_print_version

# 需要导入模块: from sys import version_info [as 别名]
# 或者: from sys.version_info import minor [as 别名]
def _cli_print_version(ctx: Context, _: Any, value: Any) -> None:  # pragma: no cover
    if not value or ctx.resilient_parsing:
        return
    location = dirname(__file__)
    echo(f'{__version} from {location} (python {version_info.major}.{version_info.minor})')
    ctx.exit() 
开发者ID:k4cg,项目名称:nichtparasoup,代码行数:8,代码来源:cli.py

示例3: test_wrong_initialisation

# 需要导入模块: from sys import version_info [as 别名]
# 或者: from sys.version_info import minor [as 别名]
def test_wrong_initialisation(self):

        if version_info.minor < 6:
            self.submission_queue = mp.Queue(-1)
            logger, listener, logging_queue = self.create_logger("test_wrong_initialisation", simple=False)
        else:
            logger, listener, logging_queue = self.create_logger("test_wrong_initialisation", simple=True)

        kwds = {"batch_file": tempfile.mkstemp(),
                "logging_queue": logging_queue,
                "identifier": 0,
                "shelve_stacks": [tempfile.mkstemp()],
                "fasta_out": self.fasta_out,
                "gtf_out": self.gtf_out,
                "tmpdir": tempfile.gettempdir(),
                "fasta": self.fasta,
                "seed": None,
                "log_level": "WARNING"
                }

        for key in ["batch_file", "logging_queue", "identifier", "lenient"]:
            with self.subTest(key=key):
                _kwds = kwds.copy()
                _kwds[key] = None
                if "queue" in key:
                    error = TypeError
                else:
                    error = ValueError
                with self.assertRaises(error):
                    checking.CheckingProcess(**_kwds)

        with self.subTest(key="fasta"):
            _kwds = kwds.copy()
            _kwds["fasta"] = None

            with self.assertRaises((AttributeError, TypeError)):
                checking.CheckingProcess(**_kwds)

        for tentative in [None, [], [("A", "G")], [("AG", bytes("GT", encoding="ascii"))]]:
            with self.subTest(tentative=tentative):
                _kwds = kwds.copy()
                _kwds["canonical_splices"] = tentative
                if tentative is None:
                    with self.assertRaises(TypeError):
                        checking.CheckingProcess(**_kwds)
                else:
                    with self.assertRaises(ValueError):
                        checking.CheckingProcess(**_kwds)

        _kwds = kwds.copy()
        _kwds["canonical_splices"] = [("AG", "GT")]
        # just test it does not raise
        _ = checking.CheckingProcess(**_kwds) 
开发者ID:EI-CoreBioinformatics,项目名称:mikado,代码行数:55,代码来源:prepare_misc_test.py


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