Author: georg.brandl
Date: Wed Sep 12 21:44:18 2007
New Revision: 58127

Modified:
   python/branches/py3k/Lib/pdb.py
Log:
Repair a bad translation of the exec statement.
Fixes #1038: pdb command line invocation fails.


Modified: python/branches/py3k/Lib/pdb.py
==============================================================================
--- python/branches/py3k/Lib/pdb.py     (original)
+++ python/branches/py3k/Lib/pdb.py     Wed Sep 12 21:44:18 2007
@@ -1166,12 +1166,8 @@
         self._wait_for_mainpyfile = 1
         self.mainpyfile = self.canonic(filename)
         self._user_requested_quit = 0
-        fp = open(filename)
-        try:
-            script = fp.read()
-        finally:
-            fp.close()
-        statement = 'exec("%s")' % script
+        with open(filename) as fp:
+            statement = fp.read()
         self.run(statement)
 
 # Simplified interface
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to