click_completion.py 文件源码

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

项目:pipenv 作者: pypa 项目源码 文件源码
def get_auto_shell():
    """Return the shell that is calling this process"""
    try:
        import psutil
        parent = psutil.Process(os.getpid()).parent()
        if platform.system() == 'Windows':
            parent = parent.parent() or parent
        return parent.name().replace('.exe', '')
    except ImportError:
        raise click.UsageError("Please explicitly give the shell type or install the psutil package to activate the"
                               " automatic shell detection.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号