##// END OF EJS Templates
Revert PR #5388...
Thomas Kluyver -
Show More
@@ -26,7 +26,6 b' from __future__ import print_function'
26 26 import sys
27 27
28 28 from IPython.core.formatters import _safe_get_formatter_method
29 from IPython.core import inputsplitter
30 29 from IPython.config.configurable import Configurable
31 30 from IPython.utils import io
32 31 from IPython.utils.py3compat import builtin_mod
@@ -101,7 +100,7 b' class DisplayHook(Configurable):'
101 100 # do not print output if input ends in ';'
102 101 try:
103 102 cell = self.shell.history_manager.input_hist_parsed[self.prompt_count]
104 return inputsplitter.remove_comments(cell).rstrip().endswith(';')
103 return cell.rstrip().endswith(';')
105 104 except IndexError:
106 105 # some uses of ipshellembed may fail here
107 106 return False
@@ -98,13 +98,13 b' class InteractiveShellTestCase(unittest.TestCase):'
98 98 def test_dont_cache_with_semicolon(self):
99 99 "Ending a line with semicolon should not cache the returned object (GH-307)"
100 100 oldlen = len(ip.user_ns['Out'])
101 for cell in ['1;', '1; #a', '1;1;']:
101 for cell in ['1;', '1;1;']:
102 102 ip.run_cell(cell, store_history=True)
103 103 newlen = len(ip.user_ns['Out'])
104 104 self.assertEqual(oldlen, newlen)
105 105 i = 0
106 106 #also test the default caching behavior
107 for cell in ['1', '1 #;', '1;1']:
107 for cell in ['1', '1;1']:
108 108 ip.run_cell(cell, store_history=True)
109 109 newlen = len(ip.user_ns['Out'])
110 110 i += 1
General Comments 0
You need to be logged in to leave comments. Login now