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

Function cleanup_temp_dir

Lib/test/libregrtest/utils.py:716–727  ·  view source on GitHub ↗
(tmp_dir: StrPath)

Source from the content-addressed store, hash-verified

714
715
716def cleanup_temp_dir(tmp_dir: StrPath) -> None:
717 import glob
718
719 path = os.path.join(glob.escape(tmp_dir), TMP_PREFIX + '*')
720 print("Cleanup %s directory" % tmp_dir)
721 for name in glob.glob(path):
722 if os.path.isdir(name):
723 print("Remove directory: %s" % name)
724 os_helper.rmtree(name)
725 else:
726 print("Remove file: %s" % name)
727 os_helper.unlink(name)
728
729
730ILLEGAL_XML_CHARS_RE = re.compile(

Callers 1

mainMethod · 0.85

Calls 5

escapeMethod · 0.80
joinMethod · 0.45
globMethod · 0.45
isdirMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…