def processEnded(self, reason):
        """
        Called by Twisted when the cftp client process ends.
        """
        self._processEnded = True
        if self.onProcessEnd:
            d, self.onProcessEnd = self.onProcessEnd, None
            d.callback(None)

        Called by Twisted when the cftp client process ends.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_cftp.py