Skip to content

Commit 3107150

Browse files
committed
Added fall back print statements in case logger is unavailable
1 parent d900b9d commit 3107150

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/shared.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,11 @@ def lookupAppdataFolder():
118118
if "HOME" in environ:
119119
dataFolder = path.join(os.environ["HOME"], "Library/Application Support/", APPNAME) + '/'
120120
else:
121+
stringToLog = 'Could not find home folder, please report this message and your OS X version to the BitMessage Github.'
121122
if 'logger' in globals():
122-
logger.critical('Could not find home folder, please report this message and your '
123-
'OS X version to the BitMessage Github.')
123+
logger.critical(stringToLog)
124+
else:
125+
print stringToLog
124126
sys.exit()
125127

126128
elif 'win32' in sys.platform or 'win64' in sys.platform:
@@ -134,8 +136,11 @@ def lookupAppdataFolder():
134136

135137
# Migrate existing data to the proper location if this is an existing install
136138
try:
139+
stringToLog = "Moving data folder to %s" % (dataFolder)
137140
if 'logger' in globals():
138-
logger.info("Moving data folder to %s" % (dataFolder))
141+
logger.info(stringToLog)
142+
else:
143+
print stringToLog
139144
move(path.join(environ["HOME"], ".%s" % APPNAME), dataFolder)
140145
except IOError:
141146
pass

0 commit comments

Comments
 (0)