Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix get_fullname with semanal when the object is removed
  • Loading branch information
hamdanal committed May 13, 2023
commit 672ec3f37b4e7f947bc0f44527b82ae007924bf8
8 changes: 7 additions & 1 deletion mypy/stubgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
TupleExpr,
TypeInfo,
UnaryExpr,
Var,
)
from mypy.options import Options as MypyOptions
from mypy.stubdoc import Sig, find_unique_signatures, parse_all_signatures
Expand Down Expand Up @@ -856,7 +857,12 @@ def process_decorator(self, o: Decorator) -> None:

def get_fullname(self, expr: Expression) -> str:
"""Return the full name resolving imports and import aliases."""
if self.analyzed and isinstance(expr, (NameExpr, MemberExpr)) and expr.fullname:
if (
self.analyzed
and isinstance(expr, (NameExpr, MemberExpr))
and expr.fullname
and not (isinstance(expr.node, Var) and expr.node.is_suppressed_import)
):
return expr.fullname
name = get_qualified_name(expr)
if "." not in name:
Expand Down