Skip to content

Commit 95337f3

Browse files
pre-commit-ci[bot]zenlyj
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent ad266ae commit 95337f3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Fix false negative for `used-before-assignment` when a `TYPE_CHECKING` import is used as a type annotation prior to erroneous usage.
22

3-
Refs #8893
3+
Refs #8893

pylint/checkers/variables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1985,7 +1985,7 @@ def _filter_type_checking_import_from_consumption(
19851985
self,
19861986
node: nodes.NodeNG,
19871987
nodes_to_consume: list[nodes.NodeNG],
1988-
is_reported: bool
1988+
is_reported: bool,
19891989
) -> list[nodes.NodeNG]:
19901990
"""Do not consume type-checking import node as used-before-assignment
19911991
may invoke in different scopes.

tests/functional/u/used/used_before_assignment_scoping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ def func():
1515
first: datetime
1616
first = datetime.now() # [used-before-assignment]
1717
second = datetime.now()
18-
return first, second
18+
return first, second

0 commit comments

Comments
 (0)