code: def next(self):
          
          _LOGGER.debug("reading next")
          if self.closed:
              _LOGGER.debug("stream is closed")
              raise StopIteration()
  
          line = self.readline()
          if not line:
              _LOGGER.debug("nothing more to read")
              raise StopIteration()
  
          return line
docs: Provides hook for Python2 iterator functionality.