From: W. Trevor King Date: Thu, 20 Feb 2014 19:02:29 +0000 (-0800) Subject: server: Create the cache directory if it doesn't already exist X-Git-Tag: v0.1~29 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e81ad599d1d3ba888c7728a1eaad815c4979fd10;p=package-cache.git server: Create the cache directory if it doesn't already exist --- diff --git a/package_cache/server.py b/package_cache/server.py index 9fea4a5..4f1e6b0 100644 --- a/package_cache/server.py +++ b/package_cache/server.py @@ -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: