|
84 | 84 | join_formatted_strings, |
85 | 85 | tokenizer_format_call, |
86 | 86 | ) |
| 87 | +from mypyc.primitives.bytes_ops import ( |
| 88 | + bytes_decode_ascii_strict, |
| 89 | + bytes_decode_latin1_strict, |
| 90 | + bytes_decode_utf8_strict, |
| 91 | +) |
87 | 92 | from mypyc.primitives.dict_ops import ( |
88 | 93 | dict_items_op, |
89 | 94 | dict_keys_op, |
90 | 95 | dict_setdefault_spec_init_op, |
91 | 96 | dict_values_op, |
92 | 97 | ) |
93 | | -from mypyc.primitives.bytes_ops import bytes_decode_utf8_strict, bytes_decode_latin1_strict, bytes_decode_ascii_strict |
94 | 98 | from mypyc.primitives.list_ops import new_list_set_item_op |
95 | 99 | from mypyc.primitives.str_ops import ( |
96 | 100 | str_encode_ascii_strict, |
@@ -779,11 +783,17 @@ def bytes_decode_fast_path(builder: IRBuilder, expr: CallExpr, callee: RefExpr) |
779 | 783 | normalized = encoding.lower().replace("-", "").replace("_", "") |
780 | 784 |
|
781 | 785 | if normalized in ("utf8", "utf", "u8", "cp65001"): |
782 | | - return builder.primitive_op(bytes_decode_utf8_strict, [builder.accept(callee.expr)], expr.line) |
| 786 | + return builder.primitive_op( |
| 787 | + bytes_decode_utf8_strict, [builder.accept(callee.expr)], expr.line |
| 788 | + ) |
783 | 789 | elif normalized in ("ascii", "usascii", "646"): |
784 | | - return builder.primitive_op(bytes_decode_ascii_strict, [builder.accept(callee.expr)], expr.line) |
| 790 | + return builder.primitive_op( |
| 791 | + bytes_decode_ascii_strict, [builder.accept(callee.expr)], expr.line |
| 792 | + ) |
785 | 793 | elif normalized in ("latin1", "latin", "iso88591", "cp819", "8859", "l1"): |
786 | | - return builder.primitive_op(bytes_decode_latin1_strict, [builder.accept(callee.expr)], expr.line) |
| 794 | + return builder.primitive_op( |
| 795 | + bytes_decode_latin1_strict, [builder.accept(callee.expr)], expr.line |
| 796 | + ) |
787 | 797 |
|
788 | 798 | return None |
789 | 799 |
|
|
0 commit comments