__init__.py 文件源码

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

项目:dockeroo 作者: dockeroo 项目源码 文件源码
def copy_tree(self, origin, destination, ignore=None):
        if os.path.exists(destination):
            raise shutil.Error(
                '''Destination already exists: "{}"'''.format(destination))
        self.logger.debug('Copying "%s" to "%s"', origin, destination)
        try:
            shutil.copytree(origin, destination,
                            ignore=shutil.ignore_patterns(*ignore or []))
        except (shutil.Error, OSError) as error:
            try:
                shutil.rmtree(destination, ignore_errors=True)
            except (shutil.Error, OSError) as strerror:
                self.logger.error('Error occurred when cleaning after error: "%s"', strerror)
            raise error
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号