'Check that InteractiveShell is protected from bad return types in custom exception handlers'

def test_bad_custom_tb_return(self):

    ip.set_custom_exc((NameError,), (lambda etype, value, tb, tb_offset=None: 1))
    self.assertEqual(ip.custom_exceptions, (NameError,))
    with tt.AssertPrints('Custom    TB    Handler    failed', channel='stderr'):
        ip.run_cell(u'a=abracadabra')
    self.assertEqual(ip.custom_exceptions, ())
