server: Create the cache directory if it doesn't already exist
authorW. Trevor King <wking@tremily.us>
Thu, 20 Feb 2014 19:02:29 +0000 (11:02 -0800)
committerW. Trevor King <wking@tremily.us>
Thu, 20 Feb 2014 19:23:43 +0000 (11:23 -0800)
package_cache/server.py

index 9fea4a56db8355dc356c70227e1ea45f435ca919..4f1e6b09a79b3eee0dfabafa33862dad10a5c4d7 100644 (file)
@@ -16,6 +16,8 @@ class Server (object):
     def __init__(self, sources, cache):
         self.sources = sources
         self.cache = cache
+        if not _os.path.isdir(self.cache):
+            _os.makedirs(path=self.cache, exist_ok=True)
 
     def __call__(self, environ, start_response):
         try: