pathutils.py 文件源码

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

项目:karton 作者: karton 项目源码 文件源码
def copy_path(src, dst):
    '''
    Copy file or directory `src` to `dst`.

    This is equivalent to `shutil.copyfile` if `src` is a file or `shutil.copytree` if
    `dst` is a directory.

    src:
        The source file or directory.
    dst:
        The destination.
    '''
    try:
        shutil.copyfile(src, dst)
    except OSError as exc:
        if exc.errno == errno.EISDIR:
            shutil.copytree(src, dst)
        else:
            raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号