diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-03-21 11:53:22 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-03-21 11:53:22 +0300 |
commit | c7e590818a16704620d029616e3d59d3d48446a5 (patch) | |
tree | cf502b832fdba41d3359a64232d2dd8884a763f5 /sphinx/application.py | |
parent | a3a775b1e8c09624c987eb34ea4d263063bb029b (diff) | |
parent | bdfb112f0d7d75ca6a07a917b0395216c4917283 (diff) |
Merge branch '3.x'
Diffstat (limited to 'sphinx/application.py')
-rw-r--r-- | sphinx/application.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sphinx/application.py b/sphinx/application.py index b99c227b9..f782f7639 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -161,6 +161,10 @@ class Sphinx: raise ApplicationError(__('Cannot find source directory (%s)') % self.srcdir) + if path.exists(self.outdir) and not path.isdir(self.outdir): + raise ApplicationError(__('Output directory (%s) is not a directory') % + self.srcdir) + if self.srcdir == self.outdir: raise ApplicationError(__('Source directory and destination ' 'directory cannot be identical')) @@ -348,13 +352,15 @@ class Sphinx: else __('finished with problems')) if self._warncount: if self.warningiserror: - msg = __('build %s, %s warning (with warnings treated as errors).', - 'build %s, %s warnings (with warnings treated as errors).', - self._warncount) + if self._warncount == 1: + msg = __('build %s, %s warning (with warnings treated as errors).') + else: + msg = __('build %s, %s warnings (with warnings treated as errors).') else: - msg = __('build %s, %s warning.', - 'build %s, %s warnings.', - self._warncount) + if self._warncount == 1: + msg = __('build %s, %s warning.') + else: + msg = __('build %s, %s warnings.') logger.info(bold(msg % (status, self._warncount))) else: |