(tmp_dir: StrPath)
| 714 | |
| 715 | |
| 716 | def 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 | |
| 730 | ILLEGAL_XML_CHARS_RE = re.compile( |