diff --git a/packages/python/yap_kernel/yap_ipython/yapi.py b/packages/python/yap_kernel/yap_ipython/yapi.py index 3b86834a9..56c286a16 100644 --- a/packages/python/yap_kernel/yap_ipython/yapi.py +++ b/packages/python/yap_kernel/yap_ipython/yapi.py @@ -661,7 +661,7 @@ class YAPRun(InteractiveShell): self.cell_name = str( self.shell.execution_count) self.shell.displayhook.exec_result= result cell = raw_cell.strip() - while cell[0] == '%': + while cell and cell[0] == '%': if cell[1] == '%': ## cell magic txt0 = cell[2:].split(maxsplit = 1, sep = '\n') @@ -756,75 +756,75 @@ class YAPRun(InteractiveShell): def prolog_cell(self, s): - """ - Trasform a text into program+query. A query is the - last line if the last line is non-empty and does not terminate - on a dot. You can also finish with + return pcell(s) - - `*`: you request all solutions - - ';'[N]: you want an answer; optionally you want N answers - If the line terminates on a `*/` or starts on a `%` we assume the line - is a comment. - """ - try: - sl = s.splitlines() - l = len(sl) - i = 0 - while i