tox_proclimit.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:detox 作者: tox-dev 项目源码 文件源码
def tox_addoption(parser):
    def positive_integer(value):
        ivalue = int(value)
        if ivalue <= 0:
            raise argparse.ArgumentTypeError(
                "%s is an invalid positive int value" % value)
        return ivalue

    try:
        num_proc = multiprocessing.cpu_count()
    except Exception:
        num_proc = 2
    parser.add_argument(
        "-n", "--num",
        type=positive_integer,
        action="store",
        default=num_proc,
        dest="numproc",
        help="set the number of concurrent processes "
             "(default %s)." % num_proc)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号