Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
docbuild: More reliable way of trying to remove static_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
infinity0 committed Mar 11, 2017
1 parent 03f3642 commit 05ee235
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sage_setup/docbuild/ext/multidocs.py
Expand Up @@ -284,10 +284,10 @@ def copy_static_files(self):
app.builder.info(bold('linking _static directory.'))
static_dir = os.path.join(app.builder.outdir, '_static')
master_static_dir = os.path.join('..', '_static')
if os.path.exists(static_dir):
if os.path.isdir(static_dir) and not os.path.islink(static_dir):
if os.path.lexists(static_dir):
try:
shutil.rmtree(static_dir)
else:
except OSError:
os.unlink(static_dir)
os.symlink(master_static_dir, static_dir)

Expand Down

0 comments on commit 05ee235

Please sign in to comment.