From 1f0e9dad08a358f6ae39afbc953f830ef07f221c 2011-04-08 22:20:37
From: MinRK <benjaminrk@gmail.com>
Date: 2011-04-08 22:20:37
Subject: [PATCH] fix displayhook.quiet() check

enable @ivanov's test, as it now passes

closes gh-307
---

diff --git a/IPython/core/displayhook.py b/IPython/core/displayhook.py
index 7f0817f..4f41bcd 100644
--- a/IPython/core/displayhook.py
+++ b/IPython/core/displayhook.py
@@ -162,7 +162,8 @@ class DisplayHook(Configurable):
         """Should we silence the display hook because of ';'?"""
         # do not print output if input ends in ';'
         try:
-            if self.shell.history_manager.input_hist_parsed[self.prompt_count].endswith(';\n'):
+            cell = self.shell.history_manager.input_hist_parsed[self.prompt_count]
+            if cell.rstrip().endswith(';'):
                 return True
         except IndexError:
             # some uses of ipshellembed may fail here
diff --git a/IPython/core/tests/test_interactiveshell.py b/IPython/core/tests/test_interactiveshell.py
index 8db596c..2a3b95c 100644
--- a/IPython/core/tests/test_interactiveshell.py
+++ b/IPython/core/tests/test_interactiveshell.py
@@ -64,7 +64,6 @@ class InteractiveShellTestCase(unittest.TestCase):
         ip.run_cell('tmp=1;"""a\nb"""\n')
         self.assertEquals(ip.user_ns['tmp'], 1)
 
-    @dec.skip_known_failure
     def test_dont_cache_with_semicolon(self):
         "Ending a line with semicolon should not cache the returned object (GH-307)"
         ip = get_ipython()