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