Skip to content

Commit 351c23f

Browse files
pre-commit-ci[bot]taichi-gardener
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 5b527ea commit 351c23f

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

python/taichi/lang/ast/ast_transformer.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,11 +1490,7 @@ def build_For(ctx, node):
14901490
raise TaichiSyntaxError("'ti.static' cannot be nested")
14911491
with ctx.loop_scope_guard(is_static=True):
14921492
return ASTTransformer.build_static_for(ctx, node, double_decorator == "grouped")
1493-
elif (
1494-
isinstance(node.iter, ast.Call)
1495-
and isinstance(node.iter.func, ast.Name)
1496-
and node.iter.func.id == "range"
1497-
):
1493+
elif isinstance(node.iter, ast.Call) and isinstance(node.iter.func, ast.Name) and node.iter.func.id == "range":
14981494
with ctx.loop_scope_guard(is_static=True):
14991495
return ASTTransformer.build_range_for(ctx, node)
15001496

@@ -1509,10 +1505,7 @@ def build_For(ctx, node):
15091505
return ASTTransformer.build_struct_for(ctx, node, is_grouped=True)
15101506
elif isinstance(iterable, mesh.MeshElementField):
15111507
if not _ti_core.is_extension_supported(impl.default_cfg().arch, _ti_core.Extension.mesh):
1512-
raise Exception(
1513-
"Backend " + str(impl.default_cfg().arch) +
1514-
" doesn't support MeshTaichi extension"
1515-
)
1508+
raise Exception("Backend " + str(impl.default_cfg().arch) + " doesn't support MeshTaichi extension")
15161509
return ASTTransformer.build_mesh_for(ctx, node)
15171510
elif isinstance(iterable, mesh.MeshRelationAccessProxy):
15181511
return ASTTransformer.build_nested_mesh_for(ctx, node)

0 commit comments

Comments
 (0)