delegator.py 文件源码

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

项目:pipenv 作者: pypa 项目源码 文件源码
def _expand_args(command):
    """Parses command strings and returns a Popen-ready list."""

    # Prepare arguments.
    if isinstance(command, STR_TYPES):
        splitter = shlex.shlex(command.encode('utf-8'))
        splitter.whitespace = '|'
        splitter.whitespace_split = True
        command = []

        while True:
            token = splitter.get_token()
            if token:
                command.append(token)
            else:
                break

        command = list(map(shlex.split, command))

    return command
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号