<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def abort(self):
 """ Abort the stream. The stream is flushed and the internal data structures are cleaned up. No stream footer is sent. The stream is :attr:`closed` afterwards. If the stream is already :attr:`closed`, this method does nothing. """

        if self._closed:
            return
        self._closed = True
        self._writer.flush()
        del self._writer