File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -274,23 +274,23 @@ def lookupNamecoinFolder():
274
274
.. todo:: Check whether this works on other platforms as well!
275
275
"""
276
276
277
- app = "namecoin"
278
- from os import path , environ
277
+ APPNAME = "namecoin"
279
278
if sys .platform == "darwin" :
280
- if "HOME" in environ :
281
- dataFolder = path .join (os .environ ["HOME" ],
282
- "Library/Application Support/" , app ) + '/'
283
- else :
284
- print (
279
+ try :
280
+ dataFolder = os .path .join (
281
+ os .environ ['HOME' ],
282
+ "Library/Application Support/" , APPNAME ) + '/'
283
+ except KeyError :
284
+ sys .exit (
285
285
"Could not find home folder, please report this message"
286
- " and your OS X version to the BitMessage Github."
287
- )
288
- sys .exit ()
289
-
290
- elif "win32" in sys .platform or "win64" in sys .platform :
291
- dataFolder = path .join (environ ["APPDATA" ], app ) + "\\ "
286
+ " and your OS X version to the BitMessage Github." )
287
+ elif sys .platform .startswith ('win' ):
288
+ dataFolder = os .path .join (
289
+ os .environ ['APPDATA' ], APPNAME
290
+ ).decode (sys .getfilesystemencoding (), 'ignore' ) + os .path .sep
292
291
else :
293
- dataFolder = path .join (environ ["HOME" ], ".%s" % app ) + "/"
292
+ dataFolder = os .path .join (
293
+ os .environ ['HOME' ], ".%s" % APPNAME ) + os .path .sep
294
294
295
295
return dataFolder
296
296
You can’t perform that action at this time.
0 commit comments