diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-04-14 13:35:33 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-04-14 13:35:33 +0300 |
commit | efc3405c6f860df834bca7f8adc09f6d49cc48a5 (patch) | |
tree | 19f55b392bcbcddeaa0bbac54e58b3879f1ca8f7 /sphinx/cmd | |
parent | f4a98d8ca0cc88a5a993a6b90a3af0892fdc19c0 (diff) | |
parent | 4f1aa2c3296deaf27878c9c9cf4d8c0ca4c3715b (diff) |
Merge branch '2.0'
Diffstat (limited to 'sphinx/cmd')
-rw-r--r-- | sphinx/cmd/make_mode.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sphinx/cmd/make_mode.py b/sphinx/cmd/make_mode.py index 82a88933d..e87aa02fc 100644 --- a/sphinx/cmd/make_mode.py +++ b/sphinx/cmd/make_mode.py @@ -72,11 +72,19 @@ class Make: def build_clean(self): # type: () -> int + srcdir = path.abspath(self.srcdir) + builddir = path.abspath(self.builddir) if not path.exists(self.builddir): return 0 elif not path.isdir(self.builddir): print("Error: %r is not a directory!" % self.builddir) return 1 + elif srcdir == builddir: + print("Error: %r is same as source directory!" % self.builddir) + return 1 + elif path.commonpath([srcdir, builddir]) == builddir: + print("Error: %r directory contains source directory!" % self.builddir) + return 1 print("Removing everything under %r..." % self.builddir) for item in os.listdir(self.builddir): rmtree(self.builddir_join(item)) |