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
评论列表
文章目录