mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
Kill execfile(), use exec() instead
This commit is contained in:
parent
41eaedd361
commit
016880229a
98 changed files with 179 additions and 341 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue