Try using ActiveState appdirs on Windows

This commit is contained in:
Dmitri Bogomolov 2020-04-27 18:56:35 +03:00
parent 6570a06dc7
commit 8798f2fbf5
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -54,6 +54,11 @@ def lookupAppdataFolder():
dataFolder = os.path.join(
os.environ['APPDATA'], APPNAME
).decode(sys.getfilesystemencoding(), 'ignore') + os.path.sep
try:
os.path.isdir(dataFolder)
except WindowsError:
from appdirs import user_data_dir
dataFolder = user_data_dir('PyBitmessage', False)
else:
try:
dataFolder = os.path.join(os.environ['XDG_CONFIG_HOME'], APPNAME)