File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 2525import logging .handlers
2626import os
2727import pathlib
28+ import platform
2829import plistlib
2930import queue
3031import re
@@ -150,7 +151,10 @@ class NSObject:
150151
151152script_path = sys .executable if getattr (sys , 'frozen' , False ) else os .path .realpath (__file__ ) # for pyinstaller etc
152153if sys .platform == 'darwin' and '.app/Contents/MacOS/' in script_path : # pyinstaller .app binary is within the bundle
153- script_path = '/' .join (script_path .split ('Contents/MacOS/' )[0 ].split ('/' )[:- 1 ])
154+ if float ('.' .join (platform .mac_ver ()[0 ].split ('.' )[:2 ])) >= 10.12 : # need a known path (due to App Translocation)
155+ script_path = pathlib .Path ('~/.%s/%s' % (APP_SHORT_NAME , APP_SHORT_NAME )).expanduser ()
156+ else :
157+ script_path = '.' .join (script_path .split ('Contents/MacOS/' )[0 ].split ('/' )[:- 1 ])
154158script_path = os .getcwd () if __package__ is not None else os .path .dirname (script_path ) # for packaged version (PyPI)
155159CONFIG_FILE_PATH = CACHE_STORE = os .path .join (script_path , '%s.config' % APP_SHORT_NAME )
156160CONFIG_SERVER_MATCHER = re .compile (r'^(?P<type>(IMAP|POP|SMTP))-(?P<port>\d+)$' )
You can’t perform that action at this time.
0 commit comments