|
50 | 50 |
|
51 | 51 | # FIXME we may also need to distinguish by magic_int2magic |
52 | 52 | # (for 3.8.5 Graal for example.) |
53 | | -def get_opcode(version_tuple: tuple, python_implementation, alternate_opmap=None, magic_int: int=-1): |
| 53 | +def get_opcode( |
| 54 | + version_tuple: tuple, |
| 55 | + python_implementation, |
| 56 | + alternate_opmap=None, |
| 57 | + magic_int: int = -1, |
| 58 | +): |
54 | 59 | # Set up disassembler with the right opcodes |
55 | 60 | lookup = ".".join((str(i) for i in version_tuple)) |
56 | 61 | if python_implementation == PythonImplementation.PyPy: |
@@ -198,7 +203,7 @@ def disco( |
198 | 203 | show_source=show_source, |
199 | 204 | methods=methods, |
200 | 205 | file_offsets=file_offsets, |
201 | | - is_unusual_bytecode=magic_int in GRAAL3_MAGICS |
| 206 | + is_unusual_bytecode=magic_int in GRAAL3_MAGICS, |
202 | 207 | ) |
203 | 208 |
|
204 | 209 |
|
@@ -262,9 +267,7 @@ def disco_loop( |
262 | 267 |
|
263 | 268 | if version_tuple >= (3, 11): |
264 | 269 | if bytecode.exception_entries not in (None, []): |
265 | | - exception_table = format_exception_table( |
266 | | - bytecode, version_tuple |
267 | | - ) |
| 270 | + exception_table = format_exception_table(bytecode, version_tuple) |
268 | 271 | real_out.write(exception_table + "\n") |
269 | 272 |
|
270 | 273 | for c in co.co_consts: |
@@ -345,7 +348,16 @@ def disco_loop_asm_format( |
345 | 348 | co = co.freeze() |
346 | 349 | all_fns.add(co_name) |
347 | 350 | if co.co_name != "<module>" or co.co_filename: |
348 | | - real_out.write("\n" + format_code_info(co, version_tuple, mapped_name) + "\n") |
| 351 | + real_out.write( |
| 352 | + "\n" |
| 353 | + + format_code_info( |
| 354 | + co, |
| 355 | + version_tuple, |
| 356 | + mapped_name, |
| 357 | + python_implementation=opc.python_implementation, |
| 358 | + ) |
| 359 | + + "\n" |
| 360 | + ) |
349 | 361 |
|
350 | 362 | bytecode = Bytecode(co, opc, dup_lines=True) |
351 | 363 | real_out.write(bytecode.dis(asm_format="asm") + "\n") |
|
0 commit comments