Message146646
The interactive interpreter in IDLE does not reset its compiler __future__ flags when you restart the shell.
To verify this, type into the shell:
>>> from __future__ import barry_as_FLUFL
>>> 1 != 2
You'll get a syntax error. Restart the shell and type
>>> 1 != 2
A syntax error still occurs.
The ModifiedInterpreter class in PyShell.py ultimately relies on codeop to mimic the interactive prompt. The codeop module was created specifically for remembering __future__ flags for subsequent commands.
The provided patch stores the flags of the interpreter when it first initializes, and then restores them in "restart_subprocess". It's a patch against 3.2.2. |
|
Date |
User |
Action |
Args |
2011-10-30 17:24:52 | roger.serwy | set | recipients:
+ roger.serwy, ezio.melotti |
2011-10-30 17:24:51 | roger.serwy | set | messageid: <1319995491.95.0.0388029066665.issue13296@psf.upfronthosting.co.za> |
2011-10-30 17:24:51 | roger.serwy | link | issue13296 messages |
2011-10-30 17:24:50 | roger.serwy | create | |
|