diff options
author | Antony Lee <anntzer.lee@gmail.com> | 2019-11-17 17:04:34 +0100 |
---|---|---|
committer | Antony Lee <anntzer.lee@gmail.com> | 2019-12-21 11:50:18 +0100 |
commit | 814513ba9ffb1c0c1678b33757e263393b3c12d2 (patch) | |
tree | 908868684fd1d59722ae4961acf0644293fc2316 /sphinx/application.py | |
parent | acdcf81599d49de751811269cd428850605224a1 (diff) | |
download | sphinx-git-814513ba9ffb1c0c1678b33757e263393b3c12d2.tar.gz |
Replace `a and b or c` by the more legible `b if a or c`.
Diffstat (limited to 'sphinx/application.py')
-rw-r--r-- | sphinx/application.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/application.py b/sphinx/application.py index a98e3a6a2..2284d6912 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -355,8 +355,8 @@ class Sphinx: if self._warncount and self.keep_going: self.statuscode = 1 - status = (self.statuscode == 0 and - __('succeeded') or __('finished with problems')) + status = (__('succeeded') if self.statuscode == 0 + else __('finished with problems')) if self._warncount: if self.warningiserror: msg = __('build %s, %s warning (with warnings treated as errors).', @@ -511,7 +511,7 @@ class Sphinx: logger.debug('[app] adding config value: %r', (name, default, rebuild) + ((types,) if types else ())) # type: ignore if rebuild in (False, True): - rebuild = rebuild and 'env' or '' + rebuild = 'env' if rebuild else '' self.config.add(name, default, rebuild, types) def add_event(self, name): |