Skip to content

Commit 7fe9147

Browse files
[autofix.ci] apply automated fixes (attempt 2/3)
1 parent d77ed44 commit 7fe9147

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

src/lfx/src/lfx/custom/validate.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -831,16 +831,18 @@ def prepare_global_scope(module):
831831
# type annotations in class bodies are stored as strings rather than evaluated eagerly.
832832
# Without this, `SomeProxiedType | None` in a field annotation would call `__or__` on
833833
# the `_LazyImportProxy` at class-construction time and raise TypeError.
834-
has_future_annotations = any(
835-
any(alias.name == "annotations" for alias in node.names)
836-
for node in future_imports
837-
)
834+
has_future_annotations = any(any(alias.name == "annotations" for alias in node.names) for node in future_imports)
838835
if not has_future_annotations:
839-
future_imports.insert(0, ast.fix_missing_locations(ast.ImportFrom(
840-
module="__future__",
841-
names=[ast.alias(name="annotations")],
842-
level=0,
843-
)))
836+
future_imports.insert(
837+
0,
838+
ast.fix_missing_locations(
839+
ast.ImportFrom(
840+
module="__future__",
841+
names=[ast.alias(name="annotations")],
842+
level=0,
843+
)
844+
),
845+
)
844846

845847
if definitions or future_imports:
846848
combined_module = ast.Module(body=future_imports + definitions, type_ignores=[])

0 commit comments

Comments
 (0)