Merge pull request #7123 from tk0miya/7108_ConfigError_in_conf.py

Close #7108: Allow to show an error message from conf.py via ConfigError
This commit is contained in:
Takeshi KOMIYA authored and GitHub committed 2020-02-16 17:56:46 +09:00
commit be608ca231
2 files changed
+4

No files matched your search

+1
View File
@@ -49,6 +49,7 @@ Features added
* #3077: Implement the scoping for :rst:dir:`productionlist` as indicated
in the documentation.
* #1027: Support backslash line continuation in :rst:dir:`productionlist`.
* #7108: config: Allow to show an error message from conf.py via ``ConfigError``
Bugs fixed
----------
+3
View File
@@ -324,6 +324,9 @@ def eval_config_file(filename: str, tags: Tags) -> Dict[str, Any]:
msg = __("The configuration file (or one of the modules it imports) "
"called sys.exit()")
raise ConfigError(msg)
except ConfigError:
# pass through ConfigError from conf.py as is. It will be shown in console.
raise
except Exception:
msg = __("There is a programmable error in your configuration file:\n\n%s")
raise ConfigError(msg % traceback.format_exc())