From c0222cf0c2c20004d46aa6195493361ac9ba6868 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sat, 10 Jul 2021 23:10:20 +0200 Subject: [PATCH] [#4692] Add a regression test for inference crash --- ChangeLog | 5 +++++ tests/functional/i/inference_crash_4692.py | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 tests/functional/i/inference_crash_4692.py diff --git a/ChangeLog b/ChangeLog index 8fbe87334a5..5806afcd464 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,11 @@ Release date: TBA Closes #4732 +* Fix a crash when a AttributeInferenceError was raised when + failing to find the real name in infer_import_from. + + Closes #4692 + What's New in Pylint 2.9.4? =========================== diff --git a/tests/functional/i/inference_crash_4692.py b/tests/functional/i/inference_crash_4692.py new file mode 100644 index 00000000000..5b21fb9f1f9 --- /dev/null +++ b/tests/functional/i/inference_crash_4692.py @@ -0,0 +1,7 @@ +"""Regression test for https://github.com/PyCQA/pylint/issues/4692.""" + +import click + + +for name, item in click.__dict__.items(): + _ = isinstance(item, click.Command) and item != 'foo'