summaryrefslogtreecommitdiffstats
path: root/Demo/scripts
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-08-12 00:43:29 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-08-12 00:43:29 (GMT)
commit016880229a369a3fb419f3eed28b6db7c342fe71 (patch)
tree9b11de5c197bc556dd515e035327673765cd4871 /Demo/scripts
parent41eaedd3613cebc83e6b9925499369992c7a7770 (diff)
downloadcpython-016880229a369a3fb419f3eed28b6db7c342fe71.zip
cpython-016880229a369a3fb419f3eed28b6db7c342fe71.tar.gz
cpython-016880229a369a3fb419f3eed28b6db7c342fe71.tar.bz2
Kill execfile(), use exec() instead
Diffstat (limited to 'Demo/scripts')
-rwxr-xr-xDemo/scripts/newslist.py2
-rwxr-xr-xDemo/scripts/pp.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/Demo/scripts/newslist.py b/Demo/scripts/newslist.py
index 7038380..3d65a08 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 486986a..9010b7a 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)