From: Jaen Saul Date: Fri, 19 Nov 2021 20:12:44 +0000 (+0200) Subject: fix(mypy): Placeholder vars should have fullname set. X-Git-Tag: rel_2_0_0b1~539^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c170ade108b907c4ea6c7a73cc606afd1838885;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fix(mypy): Placeholder vars should have fullname set. Otherwise the dmypy daemon will crash on an incremental re-run. Fixes: #7347 Closes: #7348 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7348 Pull-request-sha: 79eefa3417e09a8f9defaeafdb9f76d323385238 Change-Id: Id2133e837ee5dcf43461af51458e296353bdad6c --- diff --git a/doc/build/changelog/unreleased_14/7347.rst b/doc/build/changelog/unreleased_14/7347.rst new file mode 100644 index 0000000000..f259112fd9 --- /dev/null +++ b/doc/build/changelog/unreleased_14/7347.rst @@ -0,0 +1,6 @@ +.. change:: + :tags: bug, mypy + :tickets: 7321 + + Fixed Mypy crash when running id daemon mode caused by a + missing attribute on an internal mypy ``Var`` instance. diff --git a/lib/sqlalchemy/ext/mypy/apply.py b/lib/sqlalchemy/ext/mypy/apply.py index b3af0560c6..99be194cdc 100644 --- a/lib/sqlalchemy/ext/mypy/apply.py +++ b/lib/sqlalchemy/ext/mypy/apply.py @@ -293,6 +293,7 @@ def _apply_placeholder_attr_to_class( else: type_ = AnyType(TypeOfAny.special_form) var = Var(attrname) + var._fullname = cls.fullname + "." + attrname var.info = cls.info var.type = type_ cls.info.names[attrname] = SymbolTableNode(MDEF, var)