Message89613
Thanks for the test case.
It appears that 2.7 actually calls exec("execfile(filename)"),
when 3.1 directly calls exec(file_content).
The indirection seems necessary: the SyntaxError is detected by the pdb
trace function; but this function has to run somehow...
With the patch below, pdb now runs exec("exec(file_content)").
I'm not sure how to write unit tests for pdb.
I don't know if it will be accepted for 3.1 final.
Index: Lib/pdb.py
===================================================================
--- Lib/pdb.py (revision 73505)
+++ Lib/pdb.py (working copy)
@@ -1211,7 +1211,7 @@
self.mainpyfile = self.canonic(filename)
self._user_requested_quit = 0
with open(filename) as fp:
- statement = fp.read()
+ statement = "exec(%r)" % (fp.read(),)
self.run(statement)
# Simplified interface |
|
Date |
User |
Action |
Args |
2009-06-22 21:34:59 | amaury.forgeotdarc | set | recipients:
+ amaury.forgeotdarc, inducer, nlopes |
2009-06-22 21:34:58 | amaury.forgeotdarc | set | messageid: <1245706498.99.0.193981364904.issue6323@psf.upfronthosting.co.za> |
2009-06-22 21:34:56 | amaury.forgeotdarc | link | issue6323 messages |
2009-06-22 21:34:55 | amaury.forgeotdarc | create | |
|