'Check that InteractiveShell is protected from bad custom exception handlers'

def test_bad_custom_tb(self):

    ip.set_custom_exc((IOError,), (lambda etype, value, tb: (1 / 0)))
    self.assertEqual(ip.custom_exceptions, (IOError,))
    with tt.AssertPrints('Custom    TB    Handler    failed', channel='stderr'):
        ip.run_cell(u'raise    IOError("foo")')
    self.assertEqual(ip.custom_exceptions, ())
