diff options
| author | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-12 00:43:29 +0000 |
|---|---|---|
| committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-12 00:43:29 +0000 |
| commit | 016880229a369a3fb419f3eed28b6db7c342fe71 (patch) | |
| tree | 9b11de5c197bc556dd515e035327673765cd4871 /Demo/scripts | |
| parent | 41eaedd3613cebc83e6b9925499369992c7a7770 (diff) | |
| download | cpython-git-016880229a369a3fb419f3eed28b6db7c342fe71.tar.gz | |
Kill execfile(), use exec() instead
Diffstat (limited to 'Demo/scripts')
| -rwxr-xr-x | Demo/scripts/newslist.py | 2 | ||||
| -rwxr-xr-x | Demo/scripts/pp.py | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Demo/scripts/newslist.py b/Demo/scripts/newslist.py index 7038380f5c..3d65a08381 100755 --- a/Demo/scripts/newslist.py +++ b/Demo/scripts/newslist.py @@ -99,7 +99,7 @@ for dir in os.curdir, os.environ['HOME']: rcfile = os.path.join(dir, '.newslistrc.py') if os.path.exists(rcfile): print(rcfile) - execfile(rcfile) + exec(open(rcfile).read()) break from nntplib import NNTP diff --git a/Demo/scripts/pp.py b/Demo/scripts/pp.py index 486986ae34..9010b7af4d 100755 --- a/Demo/scripts/pp.py +++ b/Demo/scripts/pp.py @@ -123,8 +123,9 @@ import tempfile fp = tempfile.NamedTemporaryFile() fp.write(program) fp.flush() +script = open(tfn).read() if DFLAG: import pdb - pdb.run('execfile(%r)' % (tfn,)) + pdb.run(script) else: - execfile(tfn) + exec(script) |
