summaryrefslogtreecommitdiff
path: root/giscanner/cachestore.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@async.com.br>2008-12-08 20:05:29 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-12-08 20:05:29 +0000
commit076bf783f0a4e1362f08cbc2dd986f85a8afaf5f (patch)
tree5f59d305786a3cbda7aa8f2dfdb5f60de5062056 /giscanner/cachestore.py
parent191c26bd58eefd0a7403a8d696ead1b515aed778 (diff)
downloadgobject-introspection-076bf783f0a4e1362f08cbc2dd986f85a8afaf5f.tar.gz
Don't require HOME to be set and if it set, don't require the directory to
2008-12-08 Johan Dahlin <johan@async.com.br> * giscanner/cachestore.py (_get_cachedir): Don't require HOME to be set and if it set, don't require the directory to exist. svn path=/trunk/; revision=987
Diffstat (limited to 'giscanner/cachestore.py')
-rw-r--r--giscanner/cachestore.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/giscanner/cachestore.py b/giscanner/cachestore.py
index b2fee6aa..f7f0062a 100644
--- a/giscanner/cachestore.py
+++ b/giscanner/cachestore.py
@@ -26,7 +26,13 @@ import tempfile
def _get_cachedir():
- cachedir = os.path.join(os.environ['HOME'], '.cache')
+ homedir = os.environ.get('HOME')
+ if homedir is None:
+ return None
+ if not os.path.exists(homedir):
+ return None
+
+ cachedir = os.path.join(homedir, '.cache')
if not os.path.exists(cachedir):
os.mkdir(cachedir, 0755)