def connectionLost(self, reason):
        """Close both ends of my pipe.
        """
        if not hasattr(self, "o"):
            return
        for fd in self.i, self.o:
            try:
                os.close(fd)
            except IOError:
                pass
        del self.i, self.o
Close both ends of my pipe.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/posixbase.py