From 036940160dc82bb4c247524f07c391d002f86241 2008-02-07 16:03:16 From: vivainio Date: 2008-02-07 16:03:16 Subject: [PATCH] new attempt at fixing indexerror if input_hist is lacking --- diff --git a/IPython/Prompts.py b/IPython/Prompts.py index 4e4df18..df4030d 100644 --- a/IPython/Prompts.py +++ b/IPython/Prompts.py @@ -2,7 +2,7 @@ """ Classes for handling input/output prompts. -$Id: Prompts.py 3025 2008-02-07 15:45:43Z vivainio $""" +$Id: Prompts.py 3026 2008-02-07 16:03:16Z vivainio $""" #***************************************************************************** # Copyright (C) 2001-2006 Fernando Perez @@ -535,8 +535,12 @@ class CachedOutput: # first handle the cache and counters # do not print output if input ends in ';' - if self.prompt_count and self.input_hist[self.prompt_count].endswith(';\n'): - return + try: + if self.input_hist[self.prompt_count].endswith(';\n'): + return + except IndexError: + # some uses of ipshellembed may fail here + pass # don't use print, puts an extra space cout_write(self.output_sep) outprompt = self.shell.hooks.generate_output_prompt()