Skip to content

Commit

Permalink
Merge pull request #162 from iurisilvio/patch-1
Browse files Browse the repository at this point in the history
Make `is_exempt_module` work with an iterator
  • Loading branch information
sondrelg authored Sep 20, 2023
2 parents 18ee985 + b36062f commit 182d676
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions flake8_type_checking/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,7 @@ def visit_If(self, node: ast.If) -> Any:

def is_exempt_module(self, module_name: str) -> bool:
"""Template module name check."""
return any(
{exempt_module for exempt_module in self.exempt_modules if fnmatch.fnmatch(module_name, exempt_module)}
)
return any(fnmatch.fnmatch(module_name, exempt_module) for exempt_module in self.exempt_modules)

def add_import(self, node: Import) -> None: # noqa: C901
"""Add relevant ast objects to import lists."""
Expand Down

0 comments on commit 182d676

Please sign in to comment.