'Read data from the pipe.'

def read(self):

    l = []
    res = fdesc.readFromFD(self.r, l.append)
    if (res is None):
        if l:
            return l[0]
        else:
            return ''
    else:
        return res
