Commit 3e6c80bf authored by Jack Jansen's avatar Jack Jansen

Hmm, in some cases we don't seem to get our scriptname in argv[0].

Cater for that by working from sys.executable.
parent ba1c13db
......@@ -9,14 +9,25 @@ import os
import sys
import marshal
#
# Make sure we have an argv[0], and make _dir point to the Resources
# directory.
#
if not sys.argv or sys.argv[0][:1] == '-':
# Insert our (guessed) name.
_dir = os.path.split(sys.executable)[0] # removes "python"
_dir = os.path.split(_dir)[0] # Removes "MacOS"
_dir = os.path.join(_dir, 'Resources')
sys.argv.insert(0, '__rawmain__')
else:
_dir = os.path.split(sys.argv[0])[0]
#
# Create sys.argv
#
argvemulator.ArgvCollector().mainloop()
#
# Find the realy main program to run
# Find the real main program to run
#
_dir = os.path.split(sys.argv[0])[0]
__file__ = os.path.join(_dir, '__main__.py')
if os.path.exists(__file__):
#
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment