]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fix(mypy): Placeholder vars should have fullname set.
authorJaen Saul <jaen@saul.ee>
Fri, 19 Nov 2021 20:12:44 +0000 (22:12 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Sat, 15 Jan 2022 09:44:31 +0000 (10:44 +0100)
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

doc/build/changelog/unreleased_14/7347.rst [new file with mode: 0644]
lib/sqlalchemy/ext/mypy/apply.py

diff --git a/doc/build/changelog/unreleased_14/7347.rst b/doc/build/changelog/unreleased_14/7347.rst
new file mode 100644 (file)
index 0000000..f259112
--- /dev/null
@@ -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.
index b3af0560c60ac658460a67e2a52e65563a44ba4a..99be194cdccc9d9d2f94d6cc36d487f12c97a11b 100644 (file)
@@ -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)