def processEnded(self, status):
        """
        Deliver the process ended event to C{self.proto}.
        """
        self.pid = None
        statusMap = {
            0: ProcessDone,
            1: ProcessTerminated,
        }
        self.proto.processEnded(Failure(statusMap[status](status)))

        Deliver the process ended event to C{self.proto}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/runner/test/test_procmon.py