summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Mac/scripts/RunLibScript.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Mac/scripts/RunLibScript.py b/Mac/scripts/RunLibScript.py
index 36e9487..3a9ab7e 100644
--- a/Mac/scripts/RunLibScript.py
+++ b/Mac/scripts/RunLibScript.py
@@ -24,9 +24,9 @@ PAUSE=10
def import_as_main(name):
fp, path, (suffix, mode, type) = imp.find_module(name)
if type == imp.PY_SOURCE:
- imp.load_source('__main__', path)
+ imp.load_source('__main__', path, fp)
elif type == imp.PY_COMPILED:
- imp.load_compiled('__main__', path)
+ imp.load_compiled('__main__', path, fp)
elif type == imp.PY_RESOURCE:
imp.load_resource('__main__', path)
@@ -84,7 +84,10 @@ def interact():
def main():
curdir = os.getcwd()
import Res
- Res.OpenResFile('RunLibScript.rsrc')
+ try:
+ Res.OpenResFile('RunLibScript.rsrc')
+ except:
+ pass # Assume we're an applet already
name, argv, stdin, stdout, wdir, pause = interact()
if not name:
sys.exit(0)