MCPcopy
hub / github.com/rocky/python-uncompyle6 / compare_files

Function compare_files

uncompyle6/verify.py:516–538  ·  view source on GitHub ↗

Compare two .pyc files.

(pyc_filename1, pyc_filename2, verify)

Source from the content-addressed store, hash-verified

514
515
516def 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
541if __name__ == "__main__":

Callers

nothing calls this directly

Calls 1

cmp_code_objectsFunction · 0.70

Tested by

no test coverage detected