aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorWolfgang Müller2024-09-19 18:45:18 +0200
committerWolfgang Müller2024-09-19 18:45:18 +0200
commitabd28067c18004dcb573aa269c4b2cdb9f3372d6 (patch)
tree632fb97327caa782d57175f3b296ded5fd3e3239
parent733970b4da04b9efca1f2343f9325287352ba128 (diff)
downloadlater-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.
Diffstat (limited to '')
-rwxr-xr-xlater6
1 files changed, 2 insertions, 4 deletions
diff --git a/later b/later
index ff7c478..d60550b 100755
--- a/later
+++ b/later
@@ -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)