]> code.delx.au - webdl/commitdiff
Create directory for cache file
authorJames Bunton <jamesbunton@delx.net.au>
Wed, 22 Feb 2017 10:07:54 +0000 (21:07 +1100)
committerJames Bunton <jamesbunton@delx.net.au>
Wed, 22 Feb 2017 10:07:54 +0000 (21:07 +1100)
common.py

index 43c0e86bdbcea94fc1c423cf00e55572a86d5ae8..18460f90da696bdccbc404240d2540cf5507d6a2 100644 (file)
--- a/common.py
+++ b/common.py
@@ -31,6 +31,9 @@ CACHE_FILE = os.path.join(
     "webdl",
     "requests_cache"
 )
     "webdl",
     "requests_cache"
 )
+if not os.path.isdir(os.path.dirname(CACHE_FILE)):
+    os.makedirs(os.path.dirname(CACHE_FILE))
+
 requests_cache.install_cache(CACHE_FILE, backend='sqlite', expire_after=3600)
 
 
 requests_cache.install_cache(CACHE_FILE, backend='sqlite', expire_after=3600)