runmayatests.py 文件源码

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

项目:cmt 作者: chadmv 项目源码 文件源码
def remove_read_only(func, path, exc):
    """Called by shutil.rmtree when it encounters a readonly file.

    :param func:
    :param path:
    :param exc:
    """
    excvalue = exc[1]
    if func in (os.rmdir, os.remove) and excvalue.errno == errno.EACCES:
        os.chmod(path, stat.S_IRWXU| stat.S_IRWXG| stat.S_IRWXO) # 0777
        func(path)
    else:
        raise RuntimeError('Could not remove {0}'.format(path))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号