def connectionLost(self, reason):
        """
        Close the protocol and store the reason.
        """
        self.open = False
        self.reason = reason

        Close the protocol and store the reason.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_session.py