From 3ec0a6e5fa2e63ffc8b3a47701e2df67518e2f36 2010-08-20 07:31:29 From: Fernando Perez Date: 2010-08-20 07:31:29 Subject: [PATCH] Fix failing tests for escaped magics and undo changes to text.py. The changes to text.py were unnecessary, but since this branch has already been published and merged I'm simply undoing them rather than rebasing it and dropping that commit. --- diff --git a/IPython/core/inputsplitter.py b/IPython/core/inputsplitter.py index 6e3585f..38b2a35 100644 --- a/IPython/core/inputsplitter.py +++ b/IPython/core/inputsplitter.py @@ -727,7 +727,7 @@ class EscapedTransformer(object): "Translate lines escaped with: %" tpl = '%sget_ipython().magic(%s)' cmd = make_quoted_expr(' '.join([line_info.fpart, - line_info.rest])).strip() + line_info.rest]).strip()) return tpl % (line_info.lspace, cmd) @staticmethod diff --git a/IPython/utils/text.py b/IPython/utils/text.py index 5b80381..e354574 100644 --- a/IPython/utils/text.py +++ b/IPython/utils/text.py @@ -295,9 +295,8 @@ def make_quoted_expr(s): quote = "'''" else: # give up, backslash-escaped string will do - return '"%s"' % esc_quotes(s).strip() - txt = (s + tailpadding).strip() - res = raw + quote + txt + quote + tail + return '"%s"' % esc_quotes(s) + res = raw + quote + s + tailpadding + quote + tail return res