diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 5af556b..f308f8c 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -2118,6 +2118,9 @@ class InteractiveShell(Configurable, Magic): history. For user code calling back into IPython's machinery, this should be set to False. """ + if not cell.strip(): + return + raw_cell = cell with self.builtin_trap: cell = self.prefilter_manager.prefilter_lines(cell) diff --git a/IPython/core/tests/test_interactiveshell.py b/IPython/core/tests/test_interactiveshell.py index 2a3b95c..6c8fb79 100644 --- a/IPython/core/tests/test_interactiveshell.py +++ b/IPython/core/tests/test_interactiveshell.py @@ -41,7 +41,9 @@ class InteractiveShellTestCase(unittest.TestCase): """Just make sure we don't get a horrible error with a blank cell of input. Yes, I did overlook that.""" ip = get_ipython() + old_xc = ip.execution_count ip.run_cell('') + self.assertEquals(ip.execution_count, old_xc) def test_run_cell_multiline(self): """Multi-block, multi-line cells must execute correctly.