Skip to content

Commit

Permalink
[style] Fix typo detected by new version of codespell
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas authored Jan 28, 2025
1 parent 285a2b2 commit 378854d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions pylint/checkers/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,9 +612,9 @@ def visit_try(self, node: nodes.Try) -> None:
continue

exc_ancestors = [
anc
for anc in exception.ancestors()
if isinstance(anc, nodes.ClassDef)
a
for a in exception.ancestors()
if isinstance(a, nodes.ClassDef)
]

for previous_exc in exceptions_classes:
Expand Down
4 changes: 2 additions & 2 deletions pylint/checkers/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2339,7 +2339,7 @@ def _is_variable_violation(
# Otherwise, safe if used after assignment:
# (b := 2) and b
maybe_before_assign = defnode.value is node or any(
anc is defnode.value for anc in node.node_ancestors()
a is defnode.value for a in node.node_ancestors()
)
elif (
isinstance(defframe, nodes.ClassDef)
Expand Down Expand Up @@ -2464,7 +2464,7 @@ def _is_only_type_assignment(
# if (var := var * var) <-- "var" still undefined
isinstance(ref_node.parent, nodes.NamedExpr)
and any(
anc is ref_node.parent.value for anc in node.node_ancestors()
a is ref_node.parent.value for a in node.node_ancestors()
)
):
return False
Expand Down
8 changes: 4 additions & 4 deletions pylint/extensions/overlapping_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ def visit_try(self, node: nodes.Try) -> None:
continue

exc_ancestors = [
anc for anc in exc.ancestors() if isinstance(anc, astroid.ClassDef)
a for a in exc.ancestors() if isinstance(a, astroid.ClassDef)
]

for prev_part, prev_exc in handled_in_clause:
prev_exc_ancestors = [
anc
for anc in prev_exc.ancestors()
if isinstance(anc, astroid.ClassDef)
a
for a in prev_exc.ancestors()
if isinstance(a, astroid.ClassDef)
]
if exc == prev_exc:
self.add_message(
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/ext/no_self_use/no_self_use.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class Toto:
"""bla bal abl"""
"""Something inconsequential for the test."""

def __init__(self):
self.aaa = 2
Expand Down

0 comments on commit 378854d

Please sign in to comment.