summaryrefslogtreecommitdiff
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-08-12 00:43:29 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2007-08-12 00:43:29 +0000
commit48a31a022c39e3ed194329b949d19e014a48f1d9 (patch)
tree18afcc1017c9bf5f45abaec602b533ffdf5d4701 /Lib/pdb.py
parent1e156520ff8c4e9f69d9252a2426d319a1cc356c (diff)
downloadcpython-48a31a022c39e3ed194329b949d19e014a48f1d9.tar.gz
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 f408bf3a46..3bbf76b25d 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