diff options
Diffstat (limited to 'Mac/scripts')
-rw-r--r-- | Mac/scripts/BuildApplet.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Mac/scripts/BuildApplet.py b/Mac/scripts/BuildApplet.py index 756218f..e71ebc1 100644 --- a/Mac/scripts/BuildApplet.py +++ b/Mac/scripts/BuildApplet.py @@ -16,6 +16,18 @@ import EasyDialogs import buildtools import getopt +if not sys.executable.startswith(sys.exec_prefix): + # Oh, the joys of using a python script to bootstrap applicatin bundles + # sys.executable points inside the current application bundle. Because this + # path contains blanks (two of them actually) this path isn't usable on + # #! lines. Reset sys.executable to point to the embedded python interpreter + sys.executable = os.path.join(sys.prefix, + 'Resources/Python.app/Contents/MacOS/Python') + + # Just in case we're not in a framework: + if not os.path.exists(sys.executable): + sys.executable = os.path.join(sys.exec_prefix, 'bin/python') + def main(): try: buildapplet() |