Skip to content

Commit

Permalink
Fix unused-import false positive
Browse files Browse the repository at this point in the history
`unused-import` now observes `dummy-variables-rgx config`
Resolves pylint-dev#8500
  • Loading branch information
RSTdefg committed Apr 11, 2023
1 parent 1a1452a commit 00a2d50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pylint/checkers/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -3069,8 +3069,10 @@ def _check_imports(self, not_consumed: dict[str, list[nodes.NodeNG]]) -> None:
# Most likely a typing import if it wasn't used so far.
continue

if as_name == "_":
dummy_variables_rgx = self.linter.config.dummy_variables_rgx
if dummy_variables_rgx and dummy_variables_rgx.match(as_name):
continue

if as_name is None:
msg = f"import {imported_name}"
else:
Expand Down

0 comments on commit 00a2d50

Please sign in to comment.