Added check for logger global before attempting to log in places where logging may occur before the logger is ready
This commit is contained in:
parent
b500a01c33
commit
d900b9de70
|
@ -118,8 +118,9 @@ def lookupAppdataFolder():
|
||||||
if "HOME" in environ:
|
if "HOME" in environ:
|
||||||
dataFolder = path.join(os.environ["HOME"], "Library/Application Support/", APPNAME) + '/'
|
dataFolder = path.join(os.environ["HOME"], "Library/Application Support/", APPNAME) + '/'
|
||||||
else:
|
else:
|
||||||
logger.critical('Could not find home folder, please report this message and your '
|
if 'logger' in globals():
|
||||||
'OS X version to the BitMessage Github.')
|
logger.critical('Could not find home folder, please report this message and your '
|
||||||
|
'OS X version to the BitMessage Github.')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
elif 'win32' in sys.platform or 'win64' in sys.platform:
|
elif 'win32' in sys.platform or 'win64' in sys.platform:
|
||||||
|
@ -133,7 +134,8 @@ def lookupAppdataFolder():
|
||||||
|
|
||||||
# Migrate existing data to the proper location if this is an existing install
|
# Migrate existing data to the proper location if this is an existing install
|
||||||
try:
|
try:
|
||||||
logger.info("Moving data folder to %s" % (dataFolder))
|
if 'logger' in globals():
|
||||||
|
logger.info("Moving data folder to %s" % (dataFolder))
|
||||||
move(path.join(environ["HOME"], ".%s" % APPNAME), dataFolder)
|
move(path.join(environ["HOME"], ".%s" % APPNAME), dataFolder)
|
||||||
except IOError:
|
except IOError:
|
||||||
pass
|
pass
|
||||||
|
|
Reference in New Issue
Block a user