MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / check_dump

Function check_dump

tools/python-3.11.9-amd64/Tools/scripts/stable_abi.py:604–624  ·  view source on GitHub ↗

Check that manifest.dump() corresponds to the data. Mainly useful when debugging this script.

(manifest, filename)

Source from the content-addressed store, hash-verified

602 + 'removed from the stable ABI list or marked `abi_only`')
603
604def check_dump(manifest, filename):
605 """Check that manifest.dump() corresponds to the data.
606
607 Mainly useful when debugging this script.
608 """
609 dumped = tomllib.loads('\n'.join(manifest.dump()))
610 with filename.open('rb') as file:
611 from_file = tomllib.load(file)
612 if dumped != from_file:
613 print(f'Dump differs from loaded data!', file=sys.stderr)
614 diff = difflib.unified_diff(
615 pprint.pformat(dumped).splitlines(),
616 pprint.pformat(from_file).splitlines(),
617 '<dumped>', str(filename),
618 lineterm='',
619 )
620 for line in diff:
621 print(line, file=sys.stderr)
622 return False
623 else:
624 return True
625
626def main():
627 parser = argparse.ArgumentParser(

Callers 1

mainFunction · 0.85

Calls 9

strFunction · 0.85
splitlinesMethod · 0.80
pformatMethod · 0.80
printFunction · 0.50
loadsMethod · 0.45
joinMethod · 0.45
dumpMethod · 0.45
openMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected