Determine if two code objects are approximately equal, see are_instructions_equal for more information. :param i1: left code object to compare :param i2: right code object to compare :return: True if the two code objects are approximately equal, otherwise False.
(co1, co2)
| 94 | |
| 95 | |
| 96 | def are_code_objects_equal(co1, co2): |
| 97 | """ |
| 98 | Determine if two code objects are approximately equal, |
| 99 | see are_instructions_equal for more information. |
| 100 | |
| 101 | :param i1: left code object to compare |
| 102 | :param i2: right code object to compare |
| 103 | |
| 104 | :return: True if the two code objects are approximately equal, otherwise False. |
| 105 | """ |
| 106 | instructions1 = Bytecode(co1) |
| 107 | instructions2 = Bytecode(co2) |
| 108 | for opcode1, opcode2 in zip(instructions1, instructions2): |
| 109 | if not are_instructions_equal(opcode1, opcode2): |
| 110 | return False |
| 111 | return True |
| 112 | |
| 113 | |
| 114 | def validate_uncompyle(text, mode="exec"): |
no test coverage detected