File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,11 +144,10 @@ def convert_format_expr_to_str(
144144 for x , format_op in zip (exprs , format_ops ):
145145 node_type = builder .node_type (x )
146146 if format_op == FormatOp .STR :
147- if is_str_rprimitive (node_type ) or isinstance (x , StrExpr ):
148- # NOTE: why does mypyc think our fake StrExprs are not str rprimitives?
149- var_str = builder .accept (x )
150- elif (folded := constant_fold_expr (builder , x )) is not None :
147+ if (folded := constant_fold_expr (builder , x )) is not None :
151148 var_str = builder .accept (StrExpr (str (folded )))
149+ elif is_str_rprimitive (node_type ):
150+ var_str = builder .accept (x )
152151 elif is_int_rprimitive (node_type ) or is_short_int_rprimitive (node_type ):
153152 var_str = builder .primitive_op (int_to_str_op , [builder .accept (x )], line )
154153 else :
You can’t perform that action at this time.
0 commit comments