From 7bba25513c70cf5df8284d66b3617b7ad0b8e79b 2014-03-20 18:24:08 From: Thomas Kluyver Date: 2014-03-20 18:24:08 Subject: [PATCH] Revert PR #5388 We realised that #5388 introduces a different problem of about the same magnitude as the one it fixes (both are quite minor). A proper fix would be too invasive this close to release, and after discussion, we decided it was better to leave the same problem that has been in previous releases. --- diff --git a/IPython/core/displayhook.py b/IPython/core/displayhook.py index cd4f77e..8addec1 100644 --- a/IPython/core/displayhook.py +++ b/IPython/core/displayhook.py @@ -26,7 +26,6 @@ from __future__ import print_function import sys from IPython.core.formatters import _safe_get_formatter_method -from IPython.core import inputsplitter from IPython.config.configurable import Configurable from IPython.utils import io from IPython.utils.py3compat import builtin_mod @@ -101,7 +100,7 @@ class DisplayHook(Configurable): # do not print output if input ends in ';' try: cell = self.shell.history_manager.input_hist_parsed[self.prompt_count] - return inputsplitter.remove_comments(cell).rstrip().endswith(';') + return cell.rstrip().endswith(';') except IndexError: # some uses of ipshellembed may fail here return False diff --git a/IPython/core/tests/test_interactiveshell.py b/IPython/core/tests/test_interactiveshell.py index 213e95e..b01dc6d 100644 --- a/IPython/core/tests/test_interactiveshell.py +++ b/IPython/core/tests/test_interactiveshell.py @@ -98,13 +98,13 @@ class InteractiveShellTestCase(unittest.TestCase): def test_dont_cache_with_semicolon(self): "Ending a line with semicolon should not cache the returned object (GH-307)" oldlen = len(ip.user_ns['Out']) - for cell in ['1;', '1; #a', '1;1;']: + for cell in ['1;', '1;1;']: ip.run_cell(cell, store_history=True) newlen = len(ip.user_ns['Out']) self.assertEqual(oldlen, newlen) i = 0 #also test the default caching behavior - for cell in ['1', '1 #;', '1;1']: + for cell in ['1', '1;1']: ip.run_cell(cell, store_history=True) newlen = len(ip.user_ns['Out']) i += 1