diff options
author | Wolfgang Müller | 2024-09-19 18:45:18 +0200 |
---|---|---|
committer | Wolfgang Müller | 2024-09-19 18:45:18 +0200 |
commit | abd28067c18004dcb573aa269c4b2cdb9f3372d6 (patch) | |
tree | 632fb97327caa782d57175f3b296ded5fd3e3239 | |
parent | 733970b4da04b9efca1f2343f9325287352ba128 (diff) | |
download | later-abd28067c18004dcb573aa269c4b2cdb9f3372d6.tar.gz |
Use os.makedirs instead of os.mkdir
This will make sure that the whole directory structure will be created
if missing and saves us a try/except block with exist_ok.
-rwxr-xr-x | later | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -118,9 +118,7 @@ for path, basename, mtime in entries(): print(*output, sep="\t") if write_title_map: - try: - os.mkdir(later_cache_dir) - except FileExistsError: - pass + os.makedirs(later_cache_dir, exist_ok=True) + with open(title_map_file, "w") as handle: json.dump(title_map, handle) |