distribute_setup.py 文件源码

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

项目:microbiome-summer-school-2017 作者: aldro61 项目源码 文件源码
def _no_sandbox(function):
    def __no_sandbox(*args, **kw):
        try:
            from setuptools.sandbox import DirectorySandbox
            if not hasattr(DirectorySandbox, '_old'):
                def violation(*args):
                    pass
                DirectorySandbox._old = DirectorySandbox._violation
                DirectorySandbox._violation = violation
                patched = True
            else:
                patched = False
        except ImportError:
            patched = False

        try:
            return function(*args, **kw)
        finally:
            if patched:
                DirectorySandbox._violation = DirectorySandbox._old
                del DirectorySandbox._old

    return __no_sandbox
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号