aboutsummarybugs & patchesrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/discord_image_bridge/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/discord_image_bridge/utils.py b/src/discord_image_bridge/utils.py
index 838e9c6..55a2b14 100644
--- a/src/discord_image_bridge/utils.py
+++ b/src/discord_image_bridge/utils.py
@@ -16,7 +16,8 @@ def download_and_cache(url, filename):
if resp.status_code==200:
hash=do_hash(resp.content).hexdigest()
try:
- os.mkdir(hash[:2])
+ if not os.path.isdir(hash[:2]):
+ os.mkdir(hash[:2])
fname=os.path.join(hash[:2],hash)
with open(fname,'wb') as fd:
fd.write(resp.content)