Skip to content

Commit f5f9d30

Browse files
committed
fix
1 parent 251986e commit f5f9d30

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mypyc/irbuild/specialize.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,11 @@ def specialize_int_to_bytes(builder: IRBuilder, expr: CallExpr, callee: RefExpr)
10231023
self_arg = builder.accept(callee.expr)
10241024
length_arg = builder.accept(expr.args[0])
10251025
byteorder_expr = expr.args[1]
1026-
if not is_str_rprimitive(builder.node_type(byteorder_expr)):
1026+
if not (
1027+
is_int_rprimitive(builder.node_type(length_arg))
1028+
and is_str_rprimitive(builder.node_type(byteorder_expr))
1029+
and is_bool_rprimitive(builder.node_type(signed_arg))
1030+
):
10271031
return None
10281032
if isinstance(byteorder_expr, StrExpr):
10291033
if byteorder_expr.value == "little":

0 commit comments

Comments
 (0)