summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
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 /Lib/pdb.py
parent41eaedd3613cebc83e6b9925499369992c7a7770 (diff)
downloadcpython-016880229a369a3fb419f3eed28b6db7c342fe71.zip
cpython-016880229a369a3fb419f3eed28b6db7c342fe71.tar.gz
cpython-016880229a369a3fb419f3eed28b6db7c342fe71.tar.bz2
Kill execfile(), use exec() instead
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index f408bf3..3bbf76b 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -1164,7 +1164,12 @@ see no sign that the breakpoint was reached.
self._wait_for_mainpyfile = 1
self.mainpyfile = self.canonic(filename)
self._user_requested_quit = 0
- statement = 'execfile( "%s")' % filename
+ fp = open(filename)
+ try:
+ script = fp.read()
+ finally:
+ fp.close()
+ statement = 'exec("%s")' % script
self.run(statement)
# Simplified interface