Esempio n. 1
0
def read_message(f, timeout=None):
    # warning: 'timeout' is not really reliable and should only be used
    # for testing.  Also, it doesn't work if the file f does any buffering.
    if timeout is not None:
        import select
        iwtd, owtd, ewtd = select.select([f], [], [], timeout)
        if not iwtd:
            raise EOFError("timed out waiting for data")
    return marshal.load(f)
Esempio n. 2
0
def read_message(f, timeout=None):
    # warning: 'timeout' is not really reliable and should only be used
    # for testing.  Also, it doesn't work if the file f does any buffering.
    if timeout is not None:
        import select
        iwtd, owtd, ewtd = select.select([f], [], [], timeout)
        if not iwtd:
            raise EOFError("timed out waiting for data")
    return marshal.load(f)
Esempio n. 3
0
def read_message(f):
    return marshal.load(f)
Esempio n. 4
0
def read_message(f):
    return marshal.load(f)