diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index ed915c3..91fe12c 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -2568,7 +2568,8 @@ class InteractiveShell(SingletonConfigurable): if not nb.worksheets: return for cell in nb.worksheets[0].cells: - yield cell.input + if cell.cell_type == 'code': + yield cell.input else: with open(fname) as f: yield f.read() diff --git a/IPython/core/tests/test_run.py b/IPython/core/tests/test_run.py index a084b16..2c4e098 100644 --- a/IPython/core/tests/test_run.py +++ b/IPython/core/tests/test_run.py @@ -377,6 +377,7 @@ tclass.py: deleting object: C-third nb = current.new_notebook( worksheets=[ current.new_worksheet(cells=[ + current.new_text_cell("The Ultimate Question of Everything"), current.new_code_cell("answer=42") ]) ]