|
51 | 51 | # FIXME we may also need to distinguish by magic_int2magic |
52 | 52 | # (for 3.8.5 Graal for example.) |
53 | 53 | def get_opcode(version_tuple: tuple, python_implementation, alternate_opmap=None, magic_int: int=-1): |
54 | | - |
55 | 54 | # Set up disassembler with the right opcodes |
56 | 55 | lookup = ".".join((str(i) for i in version_tuple)) |
57 | 56 | if python_implementation == PythonImplementation.PyPy: |
58 | 57 | lookup += "PyPy" |
| 58 | + elif python_implementation == PythonImplementation.Graal: |
| 59 | + if magic_int == 21290: |
| 60 | + if version_tuple == (3, 11, 7): |
| 61 | + lookup = "3.11.7Graal" |
| 62 | + else: |
| 63 | + lookup = "3.12.7Graal" |
| 64 | + else: |
| 65 | + lookup += "Graal" |
59 | 66 | if lookup in op_imports.keys(): |
60 | 67 | if alternate_opmap is not None: |
61 | 68 | # TODO: change bytecode version number comment line to indicate altered |
62 | 69 | return remap_opcodes(op_imports[lookup], alternate_opmap) |
63 | 70 | return op_imports[lookup] |
64 | | - if python_implementation != PythonImplementation.CPyton: |
65 | | - pypy_str = f" for {python_implementation}" |
| 71 | + if python_implementation != PythonImplementation.CPython: |
| 72 | + implementation_str = f" for {python_implementation}" |
66 | 73 | else: |
67 | 74 | implementation_str = "" |
68 | 75 | raise TypeError( |
@@ -156,8 +163,8 @@ def disco( |
156 | 163 | sip_hash, |
157 | 164 | header=True, |
158 | 165 | show_filename=False, |
159 | | - python_implementation=python_implementation) |
160 | | - |
| 166 | + python_implementation=python_implementation, |
| 167 | + ) |
161 | 168 |
|
162 | 169 | # Store final output stream when there is an error. |
163 | 170 | real_out = out or sys.stdout |
|
0 commit comments