def _cleanup(self):
        """
        Called when have finished responding and are no longer queued.
        """
        if self.producer:
            self._log.failure(
                '',
                Failure(
                    RuntimeError(
                        "Producer was not unregistered for %s" % (self.uri,)
                    )
                )
            )
            self.unregisterProducer()
        self.channel.requestDone(self)
        del self.channel
        if self.content is not None:
            try:
                self.content.close()
            except OSError:
                # win32 suckiness, no idea why it does this
                pass
            del self.content
        for d in self.notifications:
            d.callback(None)
        self.notifications = []

        Called when have finished responding and are no longer queued.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/http.py