def METHOD_NAME(self):
    """Replacement readline() because built-in doesn't work with non-blocking IO"""
    fileno = self.pipe.stdout.fileno()
    while "\n" not in self.readbuf:
        try:
            read = os.read(fileno, 2**10)
        except OSError as err:
            if err.errno != errno.EAGAIN or not self.blocking:
                raise
            continue
        if not read:
            line = self.readbuf
            self.readbuf = ""
            return line
        self.readbuf += read.decode()
    pos = self.readbuf.find("\n") + 1
    line = self.readbuf[0:pos]
    self.readbuf = self.readbuf[pos:]
    return line