Skip to content

Commit 00c1f17

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 9807c3f commit 00c1f17

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

python/taichi/lang/ast/ast_transformer.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,15 @@ def build_assign_annotated(ctx, target, value, is_static_assign, annotation):
115115
else:
116116
anno = impl.expr_init(annotation)
117117
if is_static_assign:
118-
raise TaichiSyntaxError(
119-
"Static assign cannot be used on annotated assignment"
120-
)
118+
raise TaichiSyntaxError("Static assign cannot be used on annotated assignment")
121119
if is_local and not ctx.is_var_declared(target.id):
122120
var = ti_ops.cast(value, anno)
123121
var = impl.expr_init(var)
124122
ctx.create_variable(target.id, var)
125123
else:
126124
var = build_stmt(ctx, target)
127125
if var.ptr.get_rvalue_type() != anno:
128-
raise TaichiSyntaxError(
129-
"Static assign cannot have type overloading"
130-
)
126+
raise TaichiSyntaxError("Static assign cannot have type overloading")
131127
var._assign(value)
132128
return var
133129

0 commit comments

Comments
 (0)