diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-12 00:43:29 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-12 00:43:29 (GMT) |
commit | 016880229a369a3fb419f3eed28b6db7c342fe71 (patch) | |
tree | 9b11de5c197bc556dd515e035327673765cd4871 /Lib/plat-mac | |
parent | 41eaedd3613cebc83e6b9925499369992c7a7770 (diff) | |
download | cpython-016880229a369a3fb419f3eed28b6db7c342fe71.zip cpython-016880229a369a3fb419f3eed28b6db7c342fe71.tar.gz cpython-016880229a369a3fb419f3eed28b6db7c342fe71.tar.bz2 |
Kill execfile(), use exec() instead
Diffstat (limited to 'Lib/plat-mac')
-rw-r--r-- | Lib/plat-mac/appletrawmain.py | 2 | ||||
-rwxr-xr-x | Lib/plat-mac/bundlebuilder.py | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/Lib/plat-mac/appletrawmain.py b/Lib/plat-mac/appletrawmain.py index 6f2eacb..5c09e2d 100644 --- a/Lib/plat-mac/appletrawmain.py +++ b/Lib/plat-mac/appletrawmain.py @@ -41,7 +41,7 @@ if os.path.exists(__file__): # sys.argv[0] = __file__ del argvemulator, os, sys, _dir - execfile(__file__) + exec(open(__file__).read()) else: __file__ = os.path.join(_dir, '__main__.pyc') if os.path.exists(__file__): diff --git a/Lib/plat-mac/bundlebuilder.py b/Lib/plat-mac/bundlebuilder.py index e833add..d8186c1 100755 --- a/Lib/plat-mac/bundlebuilder.py +++ b/Lib/plat-mac/bundlebuilder.py @@ -322,7 +322,12 @@ ARGV_EMULATOR = """\ import argvemulator, os argvemulator.ArgvCollector().mainloop() -execfile(os.path.join(os.path.split(__file__)[0], "%(realmainprogram)s")) +fp = os.path.join(os.path.split(__file__)[0], "%(realmainprogram)s") +try: + script = fp.read() +finally: + fp.close() +exec(script) """ # |