From 7fbf00dde550e05093b499e532d84bc9740a9d3f Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Tue, 9 Jun 2020 01:34:32 +0900 Subject: [PATCH 1/3] Fix #7803: Fix typo in import-block for type annotation --- sphinx/util/nodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/util/nodes.py b/sphinx/util/nodes.py index 1ec3a19d0..510593757 100644 --- a/sphinx/util/nodes.py +++ b/sphinx/util/nodes.py @@ -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__) From 6fe80b95b32d04fb15ec1545c6b95026c7582925 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 9 Jun 2020 14:07:14 -0400 Subject: [PATCH 2/3] FIX: Fix circular import problem --- sphinx/pycode/parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sphinx/pycode/parser.py b/sphinx/pycode/parser.py index ec89a3616..d2e8fb976 100644 --- a/sphinx/pycode/parser.py +++ b/sphinx/pycode/parser.py @@ -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), []) From 55fc097833ee1e0efc689ddc85bd2af2e77f4af7 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Thu, 11 Jun 2020 02:55:53 +0900 Subject: [PATCH 3/3] Update CHANGES for PR #7811 --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index f77258250..e709d0330 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,8 @@ Features added Bugs fixed ---------- +* #7811: sphinx.util.inspect causes circular import problem + Testing --------