Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and zenlyj committed Oct 1, 2024
1 parent 2ee2ead commit aeb2789
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/whatsnew/fragments/8893.false_negative
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Fix false negative for `used-before-assignment` when a `TYPE_CHECKING` import is used as a type annotation prior to erroneous usage.

Refs #8893
Refs #8893
2 changes: 1 addition & 1 deletion pylint/checkers/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2009,7 +2009,7 @@ def _filter_type_checking_import_from_consumption(
self,
node: nodes.NodeNG,
nodes_to_consume: list[nodes.NodeNG],
is_reported: bool
is_reported: bool,
) -> list[nodes.NodeNG]:
"""Do not consume type-checking import node as used-before-assignment
may invoke in different scopes.
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/u/used/used_before_assignment_scoping.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ def func():
first: datetime
first = datetime.now() # [used-before-assignment]
second = datetime.now()
return first, second
return first, second

0 comments on commit aeb2789

Please sign in to comment.