diff options
author | rubenwardy <rw@rubenwardy.com> | 2020-07-10 20:50:25 +0100 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2020-07-10 20:50:25 +0100 |
commit | 849cdd257d2339c994003f43513c9a8b75ed8414 (patch) | |
tree | 464a8212cda59b0cf6586b2cda5aa54ec38cbcb0 | |
parent | 16b174d882fd115b62b484d20e1cbdbd457198a9 (diff) | |
download | cheatdb-849cdd257d2339c994003f43513c9a8b75ed8414.tar.xz |
Ignore FileExistsError in thumbnails
-rw-r--r-- | app/blueprints/thumbnails/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/blueprints/thumbnails/__init__.py b/app/blueprints/thumbnails/__init__.py index dbfdfc5..ef99502 100644 --- a/app/blueprints/thumbnails/__init__.py +++ b/app/blueprints/thumbnails/__init__.py @@ -26,8 +26,11 @@ ALLOWED_RESOLUTIONS=[(100,67), (270,180), (350,233)] def mkdir(path): assert path != "" and path is not None - if not os.path.isdir(path): - os.mkdir(path) + try: + if not os.path.isdir(path): + os.mkdir(path) + except FileExistsError: + pass def resize_and_crop(img_path, modified_path, size): |