(path: os.PathLike)
| 14 | |
| 15 | |
| 16 | def remove_dir(path: os.PathLike): |
| 17 | if sys.platform == 'win32': |
| 18 | # Windows being Windows. Not doing this as a recursive delete from the shell will yield |
| 19 | # "access denied" errors. Even deleting the individual files from the terminal does this. |
| 20 | # Somehow, deleting this way works correctly. |
| 21 | subprocess.call(f'rmdir /S /Q "{path}"', shell=True) |
| 22 | else: |
| 23 | shutil.rmtree(path) |
| 24 | |
| 25 | |
| 26 | if sys.platform.startswith("win"): |