PICARD-1763: Ensure macOS working dir is not the app dir\n\nAvoids crashes on startup

This commit is contained in:
Philipp Wolfer
2020-04-06 15:19:14 +02:00
committed by Philipp Wolfer
parent 079808663c
commit cba7de3c73

View File

@@ -23,6 +23,9 @@ import os
import sys
# The macOS app crashes on launch if the working directory happens to be sys._MEIPASS
os.chdir(os.path.abspath(os.path.join(sys._MEIPASS, '..', '..')))
# On macOS ensure libraries such as libdiscid.dylib get loaded from app bundle
os.environ['DYLD_FALLBACK_LIBRARY_PATH'] = '%s:%s' % (
os.path.dirname(sys.executable), os.environ.get('DYLD_FALLBACK_LIBRARY_PATH', ''))