From 0e6b27d4bdf04a772eab4a81db02c29a70c7ae48 2010-01-11 05:55:52 From: Fernando Perez Date: 2010-01-11 05:55:52 Subject: [PATCH] Fix minor error that I saw in some odd cases, not sure how to test for it. Unfortunately I don't have a reliable test case for this, it's deep in traceback handling. But I did see a few times ultratb itself crash. --- diff --git a/IPython/core/ultratb.py b/IPython/core/ultratb.py index ddb7ff0..f27c681 100644 --- a/IPython/core/ultratb.py +++ b/IPython/core/ultratb.py @@ -854,11 +854,11 @@ class VerboseTB(TBTools): with display_trap: self.pdb.reset() # Find the right frame so we don't pop up inside ipython itself - if hasattr(self,'tb'): + if hasattr(self,'tb') and self.tb is not None: etb = self.tb else: etb = self.tb = sys.last_traceback - while self.tb.tb_next is not None: + while self.tb is not None and self.tb.tb_next is not None: self.tb = self.tb.tb_next if etb and etb.tb_next: etb = etb.tb_next