summaryrefslogtreecommitdiff
path: root/Lib/pdb.py
diff options
context:
space:
mode:
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