diff options
| author | Thomas Robitaille <thomas.robitaille@gmail.com> | 2019-11-11 16:10:06 +0000 |
|---|---|---|
| committer | Thomas Robitaille <thomas.robitaille@gmail.com> | 2019-11-12 14:22:21 +0000 |
| commit | 0a437bc9d65edf842949b6f5971b326a2784144d (patch) | |
| tree | 1317a8ff35e2fa0fee2ba32529a866ec6a3df9eb /sphinx/application.py | |
| parent | a7f53a7957968e9f7daa3678ea695213af3e296e (diff) | |
| download | sphinx-git-0a437bc9d65edf842949b6f5971b326a2784144d.tar.gz | |
Give a warning when extensions are explicitly not parallel safe
Diffstat (limited to 'sphinx/application.py')
| -rw-r--r-- | sphinx/application.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/sphinx/application.py b/sphinx/application.py index 1c7a05357..9ea424dbf 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -1190,28 +1190,33 @@ class Sphinx: ``typ`` is a type of processing; ``'read'`` or ``'write'``. """ + if typ == 'read': attrname = 'parallel_read_safe' - message = __("the %s extension does not declare if it is safe " - "for parallel reading, assuming it isn't - please " - "ask the extension author to check and make it " - "explicit") + message_none = __("the %s extension does not declare if it is safe " + "for parallel reading, assuming it isn't - please " + "ask the extension author to check and make it " + "explicit") + message_false = "the %s extension is not safe for parallel reading" elif typ == 'write': attrname = 'parallel_write_safe' - message = __("the %s extension does not declare if it is safe " - "for parallel writing, assuming it isn't - please " - "ask the extension author to check and make it " - "explicit") + message_none = __("the %s extension does not declare if it is safe " + "for parallel writing, assuming it isn't - please " + "ask the extension author to check and make it " + "explicit") + message_false = "the %s extension is not safe for parallel writing" else: raise ValueError('parallel type %s is not supported' % typ) for ext in self.extensions.values(): allowed = getattr(ext, attrname, None) if allowed is None: - logger.warning(message, ext.name) + logger.warning(message_none, ext.name) logger.warning(__('doing serial %s'), typ) return False elif not allowed: + logger.warning(message_false, ext.name) + logger.warning(__('doing serial %s'), typ) return False return True |
