Georg Brandl ge...@python.org added the comment:
code.runsource() uses the single start symbol by default, which will parse
only a single statement. Only your second snippet is a single statement, while
the others are two statements.
--
nosy: +georg.brandl
resolution: - invalid
Sean smcal...@gmail.com added the comment:
Seems to me it's probably an issue with the newlines, but from
help(code.compile_command):
Compile a command and determine whether it is incomplete.
Arguments:
source -- the source string; bmay contain \n characters/b
filename
New submission from Sean smcal...@gmail.com:
I'm writing a little pre-processor that just parses python snippets out
of a file and passes them to a code.InteractiveInterpreter, and I'm
noticing some somewhat nasty stuff in how runsource handles some code.
sys.version:
'2.6.2 (r262:71600, Jul 12