Skip to content

Commit

Permalink
Added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
surge119 committed Jul 25, 2024
1 parent 0f78c51 commit e3dfe56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/fixit/rules/deprecated_abc_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def visit_Try(self, node: cst.Try) -> None:
Catch instances where a correct import is in a try block with an except block
that fails over to the deprecated import.
"""
# If a try block imports
# If a try block imports the correct import, check the except block
if m.findall(
node,
m.ImportFrom(
Expand All @@ -173,6 +173,8 @@ def visit_Try(self, node: cst.Try) -> None:
],
),
):
# For each handler, ensure it is a ImportError and check that it contains
# the deprecated import
for handler in node.handlers:
if (
import_nodes := m.findall(
Expand Down

0 comments on commit e3dfe56

Please sign in to comment.