shutil.copytree seems to throw OSError exception too

So revert to previous Exception handling
This commit is contained in:
solsTiCe d'Hiver 2012-07-09 20:07:31 +02:00
commit a0d2d34466

View file

@ -181,6 +181,7 @@ def install(path, v=False, u=False):
try: try:
shutil.copytree(path, theme_path) shutil.copytree(path, theme_path)
try:
if os.name == 'posix': if os.name == 'posix':
for root, dirs, files in os.walk(theme_path): for root, dirs, files in os.walk(theme_path):
for d in dirs: for d in dirs:
@ -189,10 +190,10 @@ def install(path, v=False, u=False):
for f in files: for f in files:
fname = os.path.join(root, f) fname = os.path.join(root, f)
os.chmod(fname, 0644) os.chmod(fname, 0644)
except shutil.Error, e:
err("Cannot copy `{p}' to `{t}':\n{e}".format(p=path, t=theme_path, e=str(e)))
except OSError, e: except OSError, e:
err("Cannot change permissions of files or directory in `{r}':\n{e}".format(r=theme_path, e=str(e)), die=False) err("Cannot change permissions of files or directory in `{r}':\n{e}".format(r=theme_path, e=str(e)), die=False)
except Exception, e:
err("Cannot copy `{p}' to `{t}':\n{e}".format(p=path, t=theme_path, e=str(e)))
def symlink(path, v=False): def symlink(path, v=False):