add 'util.expand_path()'

This commit is contained in:
Mike Fährmann
2017-10-26 00:04:28 +02:00
parent 9a41002b77
commit ea8ca4cfa4
3 changed files with 11 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ import time
import tempfile
import os.path
import functools
from . import config
from . import config, util
class CacheInvalidError(Exception):
@@ -111,7 +111,7 @@ class DatabaseCache(CacheModule):
path = config.get(("cache", "file"), path_default)
if path is None:
raise RuntimeError()
path = os.path.expanduser(os.path.expandvars(path))
path = util.expand_path(path)
self.db = sqlite3.connect(path, timeout=30, check_same_thread=False)
self.db.execute(
"CREATE TABLE IF NOT EXISTS data ("