This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients JDLH, eryksun, terry.reedy
Date 2017-02-18.02:29:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1487384964.93.0.458306926892.issue29561@psf.upfronthosting.co.za>
In-reply-to
Content
If src is effectively blank, compile(src, filename, mode) raises SyntaxError if mode is 'single' but not if it is 'exec'.  I believe IDLE compiles with 'single', but it has the behavior Jim (and I) expect and consider correct, printing '>>>' after effectively blank lines.  This is because IDLE uses code.InteractiveInterpreter, which uses codeop.compile_command, which uses codeop._maybe_compile, which replaces effectively blank statements with 'pass'.  compile('pass', '', 'single') returns a do-nothing code object.  The C-coded interactive interpreter is doing something else.
History
Date User Action Args
2017-02-18 02:29:25terry.reedysetrecipients: + terry.reedy, eryksun, JDLH
2017-02-18 02:29:24terry.reedysetmessageid: <1487384964.93.0.458306926892.issue29561@psf.upfronthosting.co.za>
2017-02-18 02:29:24terry.reedylinkissue29561 messages
2017-02-18 02:29:24terry.reedycreate