'If L{IProcessProtocol.processExited} raises an exception, it is logged.'

def test_processExitedRaises(self):

    reactor = self.buildReactor()
    class TestException(Exception, ):
        pass
    class Protocol(ProcessProtocol, ):
        def processExited(self, reason):
            reactor.stop()
            raise TestException('processedExited    raised')
    protocol = Protocol()
    transport = reactor.spawnProcess(protocol, pyExe, [pyExe, '-c', ''], usePTY=self.usePTY)
    self.runReactor(reactor)
    if (process is not None):
        for (pid, handler) in items(process.reapProcessHandlers):
            if (handler is not transport):
                continue
            process.unregisterReapProcessHandler(pid, handler)
            self.fail('After    processExited    raised,    transport    was    left    in    reapProcessHandlers')
    self.assertEqual(1, len(self.flushLoggedErrors(TestException)))
