0007824: Regression: running gramps from crontab fails

This commit is contained in:
kulath 2015-03-01 16:49:56 +00:00
parent 79942b1d00
commit 962d3bc488

View File

@ -2266,7 +2266,9 @@ def write_lock_file(name):
try:
user = os.getlogin()
except:
user = os.environ['USER'] #not win, don't need get_env_var
# not win, so don't need get_env_var.
# under cron getlogin() throws and there is no USER.
user = os.environ.get('USER', 'noUSER')
if host:
text = "%s@%s" % (user, host)
else: