mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7169 from tk0miya/fix_type_comment_i18n
Fix message is not translated in autodoc/type_comment.py
This commit is contained in:
commit
4e6676b902
@ -14,6 +14,7 @@ from typing import cast
|
||||
|
||||
import sphinx
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.locale import __
|
||||
from sphinx.pycode.ast import ast
|
||||
from sphinx.pycode.ast import parse as ast_parse
|
||||
from sphinx.pycode.ast import unparse as ast_unparse
|
||||
@ -128,7 +129,7 @@ def update_annotations_using_type_comments(app: Sphinx, obj: Any, bound_method:
|
||||
if 'return' not in obj.__annotations__:
|
||||
obj.__annotations__['return'] = type_sig.return_annotation
|
||||
except NotImplementedError as exc: # failed to ast.unparse()
|
||||
logger.warning("Failed to parse type_comment for %r: %s", obj, exc)
|
||||
logger.warning(__("Failed to parse type_comment for %r: %s"), obj, exc)
|
||||
|
||||
|
||||
def setup(app: Sphinx) -> Dict[str, Any]:
|
||||
|
Loading…
Reference in New Issue
Block a user