diff options
author | Jacob Walls <jacobtylerwalls@gmail.com> | 2022-05-13 09:40:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-13 09:40:25 -0400 |
commit | 5fee33ffcd52a9a078922a3ab881b0d165c32bfa (patch) | |
tree | 7205352162a4f7b76d252f4d7a97603c462c8b93 /tests/functional/u/unnecessary | |
parent | 55cacdbe554449f8f022916ab6c16506b2077cda (diff) | |
download | pylint-git-5fee33ffcd52a9a078922a3ab881b0d165c32bfa.tar.gz |
Fix a crash in `unnecessary-list-index-lookup` when incorrectly using `enumerate()` (#6604)
Diffstat (limited to 'tests/functional/u/unnecessary')
-rw-r--r-- | tests/functional/u/unnecessary/unnecessary_list_index_lookup.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/functional/u/unnecessary/unnecessary_list_index_lookup.py b/tests/functional/u/unnecessary/unnecessary_list_index_lookup.py index abdd64d70..ba99d3b9b 100644 --- a/tests/functional/u/unnecessary/unnecessary_list_index_lookup.py +++ b/tests/functional/u/unnecessary/unnecessary_list_index_lookup.py @@ -49,3 +49,7 @@ result = [my_list[idx] for idx, val in enumerate(my_list)] # [unnecessary-list-i pairs = [(0, 0)] for i, (a, b) in enumerate(pairs): print(pairs[i][0]) + +# Regression test for https://github.com/PyCQA/pylint/issues/6603 +for i, num in enumerate(): # raises TypeError, but shouldn't crash pylint + pass |