Fix sys._MEIPASS not decoded to unicode

This commit is contained in:
David Vierra 2016-05-05 22:40:38 -10:00
parent 30bb188171
commit 55d66b8808

View File

@ -64,6 +64,11 @@ def resourcePath(filename):
if basedir is None:
# should work across platforms
basedir = getSrcFolder()
elif sys.platform == 'win32':
basedir = basedir.decode('mbcs')
else:
basedir = basedir.decode(sys.getfilesystemencoding())
path = os.path.join(basedir, filename)
if not os.path.exists(path):
raise RuntimeError("Could not get resource path for %s\n(Tried %s which does not exist)" % (filename, path))