From 8dba49af0f78ff398852f39a05cd376a27bec9b9 2012-05-31 10:31:31 From: Thomas Kluyver Date: 2012-05-31 10:31:31 Subject: [PATCH] Remove check for custom_exceptions from showtraceback; it's checked in run_code. --- diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index bf99c91..361b7b2 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -1703,23 +1703,20 @@ class InteractiveShell(SingletonConfigurable): elif etype is UsageError: self.write_err("UsageError: %s" % value) else: - if etype in self.custom_exceptions: - stb = self.CustomTB(etype, value, tb, tb_offset) + if exception_only: + stb = ['An exception has occurred, use %tb to see ' + 'the full traceback.\n'] + stb.extend(self.InteractiveTB.get_exception_only(etype, + value)) else: - if exception_only: - stb = ['An exception has occurred, use %tb to see ' - 'the full traceback.\n'] - stb.extend(self.InteractiveTB.get_exception_only(etype, - value)) - else: - stb = self.InteractiveTB.structured_traceback(etype, - value, tb, tb_offset=tb_offset) - - self._showtraceback(etype, value, stb) - if self.call_pdb: - # drop into debugger - self.debugger(force=True) - return + stb = self.InteractiveTB.structured_traceback(etype, + value, tb, tb_offset=tb_offset) + + self._showtraceback(etype, value, stb) + if self.call_pdb: + # drop into debugger + self.debugger(force=True) + return # Actually show the traceback self._showtraceback(etype, value, stb)