From b5e3e71068c8eeb0ee5bb7770e6e26d207b7b92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Tue, 8 Feb 2022 22:13:21 +0100 Subject: Fix crash on inference of ``__dict__.items()`` of an imported module (#1367) --- tests/testdata/python3/data/module_dict_items_call/models.py | 5 +++++ tests/testdata/python3/data/module_dict_items_call/test.py | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 tests/testdata/python3/data/module_dict_items_call/models.py create mode 100644 tests/testdata/python3/data/module_dict_items_call/test.py (limited to 'tests/testdata/python3') diff --git a/tests/testdata/python3/data/module_dict_items_call/models.py b/tests/testdata/python3/data/module_dict_items_call/models.py new file mode 100644 index 00000000..212bc011 --- /dev/null +++ b/tests/testdata/python3/data/module_dict_items_call/models.py @@ -0,0 +1,5 @@ +import re + + +class MyModel: + class_attribute = 1 diff --git a/tests/testdata/python3/data/module_dict_items_call/test.py b/tests/testdata/python3/data/module_dict_items_call/test.py new file mode 100644 index 00000000..4a52b18e --- /dev/null +++ b/tests/testdata/python3/data/module_dict_items_call/test.py @@ -0,0 +1,7 @@ +import models + + +def func(): + for _, value in models.__dict__.items(): + if isinstance(value, type): + value.class_attribute += 1 -- cgit v1.2.1