Commit d8f0edfc by devttys0

Updated _get_user_dir to handle situations with no $HOME directory

parent 298cc28d
......@@ -128,11 +128,16 @@ class Settings:
'''
try:
# This should work in both Windows and Unix environments
return os.getenv('USERPROFILE') or os.getenv('HOME')
for envname in ['USERPROFILE', 'HOME']:
user_dir = os.getenv(envname)
if user_dir is not None:
return user_dir
except KeyboardInterrupt as e:
raise e
except Exception:
return ''
pass
return ''
def _file_path(self, dirname, filename):
'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment