mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7603 from eric-wieser/warning-as-error-traceback
Preserve exception info in raised SphinxWarning objects
This commit is contained in:
commit
f93e5a59b6
@ -412,9 +412,13 @@ class WarningIsErrorFilter(logging.Filter):
|
||||
message = record.msg # use record.msg itself
|
||||
|
||||
if location:
|
||||
raise SphinxWarning(location + ":" + str(message))
|
||||
exc = SphinxWarning(location + ":" + str(message))
|
||||
else:
|
||||
raise SphinxWarning(message)
|
||||
exc = SphinxWarning(message)
|
||||
if record.exc_info is not None:
|
||||
raise exc from record.exc_info[1]
|
||||
else:
|
||||
raise exc
|
||||
else:
|
||||
return True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user