From dcaabc8f44d5ae96f398b64a07ce6a8c6d919e14 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..8ed717f2a77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,11 @@ Release date: TBA Closes #4732 +* Fix a crash when a AttributeInferenceError was not handled properly when + failing to infer the real name of an import in astroid. + + 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..043c6bb1c70 --- /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 # [import-error] + + +for name, item in click.__dict__.items(): + _ = isinstance(item, click.Command) and item != 'foo'