[issue6480] code.runsource() parsing bug

2010-07-29 Thread Georg Brandl
Georg Brandl 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 status: open -> cl

[issue6480] code.runsource() parsing bug

2009-07-14 Thread Sean
Sean 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; may contain \n characters filename -- optional filename

[issue6480] code.runsource() parsing bug

2009-07-13 Thread Sean
New submission from Sean : 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 2009, 11:52:33) \n