From ae8a8f8a34e6c799d70b8770c79d4fdf335c5b51 2008-02-07 15:45:43 From: vivainio Date: 2008-02-07 15:45:43 Subject: [PATCH] do not crash if prompt_count is 0 (detected with leo ipython plugin) --- diff --git a/IPython/Prompts.py b/IPython/Prompts.py index e46aec5..4e4df18 100644 --- a/IPython/Prompts.py +++ b/IPython/Prompts.py @@ -2,7 +2,7 @@ """ Classes for handling input/output prompts. -$Id: Prompts.py 2928 2008-01-10 14:30:51Z vivainio $""" +$Id: Prompts.py 3025 2008-02-07 15:45:43Z vivainio $""" #***************************************************************************** # Copyright (C) 2001-2006 Fernando Perez @@ -535,7 +535,7 @@ class CachedOutput: # first handle the cache and counters # do not print output if input ends in ';' - if self.input_hist[self.prompt_count].endswith(';\n'): + if self.prompt_count and self.input_hist[self.prompt_count].endswith(';\n'): return # don't use print, puts an extra space cout_write(self.output_sep)