mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #4132: Failed to convert reST parser error to warning
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -39,6 +39,7 @@ Bugs fixed
|
||||
* #4149: Documentation: Help choosing :confval:`latex_engine`
|
||||
* #4090: [doc] :confval:`latex_additional_files` with extra LaTeX macros should
|
||||
not use ``.tex`` extension
|
||||
* Failed to convert reST parser error to warning (refs: #4132)
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
||||
@@ -26,8 +26,7 @@ from sphinx.locale import __
|
||||
from sphinx.util import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
report_re = re.compile('^(.+?:(?:\\d+)?): \\((DEBUG|INFO|WARNING|ERROR|SEVERE)/(\\d+)?\\) '
|
||||
'(.+?)\n?$')
|
||||
report_re = re.compile('^(.+?:(?:\\d+)?): \\((DEBUG|INFO|WARNING|ERROR|SEVERE)/(\\d+)?\\) ')
|
||||
|
||||
if False:
|
||||
# For type annotation
|
||||
@@ -162,7 +161,8 @@ class WarningStream(object):
|
||||
if not matched:
|
||||
logger.warning(text.rstrip("\r\n"))
|
||||
else:
|
||||
location, type, level, message = matched.groups()
|
||||
location, type, level = matched.groups()
|
||||
message = report_re.sub('', text).rstrip()
|
||||
logger.log(type, message, location=location)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user