fix copy(): don't raise OSError because file exists if replace parameter is True

This commit is contained in:
kraymer 2012-04-08 10:50:00 +02:00 committed by Adrian Sampson
parent 00d47b1bff
commit 8d773e27a2

View file

@ -241,7 +241,8 @@ def copy(path, dest, replace=False, pathmod=None):
return
path = syspath(path)
dest = syspath(dest)
_assert_not_exists(dest, pathmod)
if not replace:
_assert_not_exists(dest, pathmod)
return shutil.copyfile(path, dest)
def move(path, dest, replace=False, pathmod=None):