New submission from Kristján Valur Jónsson <krist...@ccpgames.com>:
The code.InteractiveConsole() is useful to emulate a python console. However, any code currently "push"ed to it must be single statements. This is because it passes the ´single´ symbol mode to the underlying compile function. This patch allows the caller of InteractiveConsole.push to specify a different mode, e.g. ´exec´. This is useful if one wants to paste entire code snippets into the console. Without it, pasting the following: 'if True:\n print 1\nprint 2' Won't run. pushing such multiline code snippets with an additional 'exec' argument will allow it to work. Patch included. ---------- components: Library (Lib) files: code.patch keywords: patch messages: 98056 nosy: krisvale severity: normal status: open title: Allow multiple statements in code.InteractiveConsole.push type: feature request versions: Python 2.7 Added file: http://bugs.python.org/file15950/code.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7741> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com