Skip to content

Commit 2d69243

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 662042f commit 2d69243

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Fixed conditional import x.y causing false positive possibly-used-before-assignment.
22

3-
Closes #10081
3+
Closes #10081

pylint/checkers/variables.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,9 @@ def _defines_name_raises_or_returns(name: str, node: nodes.NodeNG) -> bool:
931931
):
932932
return True
933933
if isinstance(node, (nodes.Import, nodes.ImportFrom)) and any(
934-
(node_name[1] and node_name[1] == name) or (node_name[0] == name) or (node_name[0].startswith(name + '.'))
934+
(node_name[1] and node_name[1] == name)
935+
or (node_name[0] == name)
936+
or (node_name[0].startswith(name + "."))
935937
for node_name in node.names
936938
):
937939
return True

0 commit comments

Comments
 (0)