MCPcopy Index your code
hub / github.com/python/cpython / clean_contents

Function clean_contents

Platforms/emscripten/__main__.py:624–641  ·  view source on GitHub ↗

Delete all files created by this script.

(context)

Source from the content-addressed store, hash-verified

622
623
624def clean_contents(context):
625 """Delete all files created by this script."""
626 if context.target in {"all", "build"}:
627 build_dir = context.build_paths["native_build_dir"]
628 if build_dir.exists():
629 print(f"🧹 Deleting {build_dir} ...")
630 shutil.rmtree(build_dir)
631
632 if context.target in {"all", "host"}:
633 host_triple_dir = context.build_paths["host_triple_dir"]
634 if host_triple_dir.exists():
635 print(f"🧹 Deleting {host_triple_dir} ...")
636 shutil.rmtree(host_triple_dir)
637
638 if LOCAL_SETUP.exists():
639 with LOCAL_SETUP.open("rb") as file:
640 if file.read(len(LOCAL_SETUP_MARKER)) == LOCAL_SETUP_MARKER:
641 print(f"🧹 Deleting generated {LOCAL_SETUP} ...")
642
643
644def add_cross_build_dir_option(subcommand):

Callers

nothing calls this directly

Calls 3

existsMethod · 0.45
openMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…