Skip to content

Commit 59c1826

Browse files
Update specialize.py
1 parent d30e0fb commit 59c1826

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mypyc/irbuild/specialize.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,10 +1059,9 @@ def translate_float(builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> Valu
10591059
def translate_ord(builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> Value | None:
10601060
if len(expr.args) != 1 or expr.arg_kinds[0] != ARG_POS:
10611061
return None
1062-
arg = expr.args[0]
1063-
folded_arg = constant_fold_expr(builder, arg)
1064-
if isinstance(folded_arg, (str, bytes)) and len(folded_arg) == 1:
1065-
return Integer(ord(folded_arg))
1062+
arg = constant_fold_expr(builder, expr.args[0])
1063+
if isinstance(arg, (str, bytes)) and len(arg) == 1:
1064+
return Integer(ord(arg))
10661065
return None
10671066

10681067

0 commit comments

Comments
 (0)