Fix a bug in SmartCopy when printing an error message
This commit is contained in:
parent
18ad481067
commit
ad726c68ec
@ -325,20 +325,22 @@ class SmartCopy(object):
|
||||
os.unlink(dst)
|
||||
|
||||
# copy all the files
|
||||
try:
|
||||
map(lambda (src, dst): shutil.copy2(src, dst), self.copyfiles)
|
||||
except shutil.Error as why:
|
||||
err_msg = "error copying file {0} -> {1}: {2}"
|
||||
err_msg = err_msg.format(src, dst, why)
|
||||
raise SmartCopyError(err_msg)
|
||||
for src, dst in self.copyfiles:
|
||||
try:
|
||||
shutil.copy2(src, dst)
|
||||
except shutil.Error as why:
|
||||
err_msg = "error copying file {0} -> {1}: {2}"
|
||||
err_msg = err_msg.format(src, dst, why)
|
||||
raise SmartCopyError(err_msg)
|
||||
|
||||
# create symlinks
|
||||
try:
|
||||
map(lambda (target, name): symlink_(target, name), self.links)
|
||||
except OSError as why:
|
||||
err_msg = "error creating symlink {0} -> {1}: {2}"
|
||||
err_msg = err_msg.format(name, target, why)
|
||||
raise SmartCopyError(err_msg)
|
||||
for target, name in self.links:
|
||||
try:
|
||||
symlink_(target, name)
|
||||
except OSError as why:
|
||||
err_msg = "error creating symlink {0} -> {1}: {2}"
|
||||
err_msg = err_msg.format(name, target, why)
|
||||
raise SmartCopyError(err_msg)
|
||||
|
||||
|
||||
# XXX
|
||||
|
Loading…
Reference in New Issue
Block a user