Compare two .pyc files.
(pyc_filename1, pyc_filename2, verify)
| 514 | |
| 515 | |
| 516 | def compare_files(pyc_filename1, pyc_filename2, verify): |
| 517 | """Compare two .pyc files.""" |
| 518 | ( |
| 519 | version1, |
| 520 | timestamp, |
| 521 | magic_int1, |
| 522 | code_obj1, |
| 523 | is_pypy, |
| 524 | source_size, |
| 525 | sip_hash, |
| 526 | ) = uncompyle6.load_module(pyc_filename1) |
| 527 | ( |
| 528 | version2, |
| 529 | timestamp, |
| 530 | magic_int2, |
| 531 | code_obj2, |
| 532 | is_pypy, |
| 533 | source_size, |
| 534 | sip_hash, |
| 535 | ) = uncompyle6.load_module(pyc_filename2) |
| 536 | if (magic_int1 != magic_int2) and verify == "verify": |
| 537 | verify = "weak_verify" |
| 538 | cmp_code_objects(version1, is_pypy, code_obj1, code_obj2, verify) |
| 539 | |
| 540 | |
| 541 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected