Merge branch '3.1.x' into 7808_complex_typehints_for_pydata

This commit is contained in:
Takeshi KOMIYA 2020-06-11 23:44:09 +09:00 committed by GitHub
commit 60a8770a63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -17,6 +17,7 @@ Bugs fixed
----------
* #7808: autodoc: Warnings raised on variable and attribute type annotations
* #7811: sphinx.util.inspect causes circular import problem
Testing
--------

View File

@ -19,7 +19,6 @@ from typing import Any, Dict, List, Optional, Tuple
from sphinx.pycode.ast import ast # for py37 or older
from sphinx.pycode.ast import parse, unparse
from sphinx.util.inspect import signature_from_ast
comment_re = re.compile('^\\s*#: ?(.*)\r?\n?$')
@ -262,6 +261,8 @@ class VariableCommentPicker(ast.NodeVisitor):
self.finals.append(".".join(qualname))
def add_overload_entry(self, func: ast.FunctionDef) -> None:
# avoid circular import problem
from sphinx.util.inspect import signature_from_ast
qualname = self.get_qualname_for(func.name)
if qualname:
overloads = self.overloads.setdefault(".".join(qualname), [])

View File

@ -31,7 +31,7 @@ if False:
from sphinx.builders import Builder
from sphinx.domain import IndexEntry
from sphinx.environment import BuildEnvironment
from sphinx.utils.tags import Tags
from sphinx.util.tags import Tags
logger = logging.getLogger(__name__)