add global WINDOWS bool

This commit is contained in:
Mike Fährmann
2020-05-19 21:42:11 +02:00
parent 6294e2c540
commit c8787647ed
6 changed files with 11 additions and 13 deletions

View File

@@ -193,7 +193,7 @@ def _path():
if path != -1:
return util.expand_path(path)
if os.name == "nt":
if util.WINDOWS:
import tempfile
return os.path.join(tempfile.gettempdir(), ".gallery-dl.cache")
@@ -205,7 +205,7 @@ def _path():
try:
dbfile = _path()
if os.name != "nt":
if not util.WINDOWS:
# restrict access permissions for new db files
os.close(os.open(dbfile, os.O_CREAT | os.O_RDONLY, 0o600))
DatabaseCacheDecorator.db = sqlite3.connect(