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/distutils/core.py | |
parent | 41eaedd3613cebc83e6b9925499369992c7a7770 (diff) | |
download | cpython-016880229a369a3fb419f3eed28b6db7c342fe71.zip cpython-016880229a369a3fb419f3eed28b6db7c342fe71.tar.gz cpython-016880229a369a3fb419f3eed28b6db7c342fe71.tar.bz2 |
Kill execfile(), use exec() instead
Diffstat (limited to 'Lib/distutils/core.py')
-rw-r--r-- | Lib/distutils/core.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/distutils/core.py b/Lib/distutils/core.py index bd9b854..d609982 100644 --- a/Lib/distutils/core.py +++ b/Lib/distutils/core.py @@ -179,7 +179,7 @@ def run_setup (script_name, script_args=None, stop_after="run"): keyword args from 'script' to 'setup()', or the contents of the config files or command-line. - 'script_name' is a file that will be run with 'execfile()'; + 'script_name' is a file that will be read and run with 'exec()'; 'sys.argv[0]' will be replaced with 'script' for the duration of the call. 'script_args' is a list of strings; if supplied, 'sys.argv[1:]' will be replaced by 'script_args' for the duration of @@ -217,7 +217,7 @@ def run_setup (script_name, script_args=None, stop_after="run"): sys.argv[0] = script_name if script_args is not None: sys.argv[1:] = script_args - execfile(script_name, g, l) + exec(open(script_name).read(), g, l) finally: sys.argv = save_argv _setup_stop_after = None |