1
0
mirror of https://github.com/Z4nzu/hackingtool.git synced 2025-06-20 06:15:54 +02:00

Use Python os.makedirs() instead of os.makedir()

Fixes #384 

[`os.makedir()`](https://docs.python.org/3/library/os.html#os.makedir) is raising `FileNotFoundError` because a parent directory in the path does not exist so let's use [`os.makedirs()`](https://docs.python.org/3/library/os.html#os.makedirs) which will create any missing parent directories.
This commit is contained in:
Christian Clauss
2023-07-18 08:17:15 +02:00
committed by GitHub
parent 64a46031b9
commit 9b900d8779

View File

@ -102,8 +102,7 @@ if __name__ == "__main__":
with open(fpath) as f:
archive = f.readline()
if not os.path.exists(archive):
os.mkdir(archive)
os.mkdirs(archive, exist_ok=True)
os.chdir(archive)
AllTools().show_options()