mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
shutil.copytree seems to throw OSError exception too
So revert to previous Exception handling
This commit is contained in:
parent
842817f110
commit
a0d2d34466
1 changed files with 12 additions and 11 deletions
|
|
@ -181,18 +181,19 @@ def install(path, v=False, u=False):
|
||||||
try:
|
try:
|
||||||
shutil.copytree(path, theme_path)
|
shutil.copytree(path, theme_path)
|
||||||
|
|
||||||
if os.name == 'posix':
|
try:
|
||||||
for root, dirs, files in os.walk(theme_path):
|
if os.name == 'posix':
|
||||||
for d in dirs:
|
for root, dirs, files in os.walk(theme_path):
|
||||||
dname = os.path.join(root, d)
|
for d in dirs:
|
||||||
os.chmod(dname, 0755)
|
dname = os.path.join(root, d)
|
||||||
for f in files:
|
os.chmod(dname, 0755)
|
||||||
fname = os.path.join(root, f)
|
for f in files:
|
||||||
os.chmod(fname, 0644)
|
fname = os.path.join(root, f)
|
||||||
except shutil.Error, e:
|
os.chmod(fname, 0644)
|
||||||
|
except OSError, e:
|
||||||
|
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)))
|
err("Cannot copy `{p}' to `{t}':\n{e}".format(p=path, t=theme_path, e=str(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)
|
|
||||||
|
|
||||||
|
|
||||||
def symlink(path, v=False):
|
def symlink(path, v=False):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue