mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
fix make clean abort when build dir contains files like .DS_Store.
This commit is contained in:
parent
736615c18c
commit
e9f5d96665
2
CHANGES
2
CHANGES
@ -5,7 +5,7 @@ Bugs fixed
|
||||
----------
|
||||
|
||||
* applehelp: Sphinx crashes if ``hiutil`` or ``codesign`` commands not found
|
||||
|
||||
* Fix ``make clean`` abort issue when build dir contains regular files like ``DS_Store``.
|
||||
|
||||
Release 1.4.5 (released Jul 13, 2016)
|
||||
=====================================
|
||||
|
@ -18,13 +18,12 @@ from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
from os import path
|
||||
from subprocess import call
|
||||
|
||||
import sphinx
|
||||
from sphinx.util.console import bold, blue
|
||||
from sphinx.util.osutil import cd
|
||||
from sphinx.util.osutil import cd, rmtree
|
||||
|
||||
proj_name = os.getenv('SPHINXPROJ', '<project>')
|
||||
|
||||
@ -75,7 +74,7 @@ class Make(object):
|
||||
return 1
|
||||
print("Removing everything under %r..." % self.builddir)
|
||||
for item in os.listdir(self.builddir):
|
||||
shutil.rmtree(self.builddir_join(item))
|
||||
rmtree(self.builddir_join(item))
|
||||
|
||||
def build_help(self):
|
||||
print(bold("Sphinx v%s" % sphinx.__display_version__))
|
||||
|
@ -213,3 +213,10 @@ def cd(target_dir):
|
||||
yield
|
||||
finally:
|
||||
os.chdir(cwd)
|
||||
|
||||
|
||||
def rmtree(path):
|
||||
if os.path.isdir(path):
|
||||
shutil.rmtree(path)
|
||||
else:
|
||||
os.remove(path)
|
||||
|
Loading…
Reference in New Issue
Block a user