- os.close(sendsock)
- throw = lambda : __throw(Exception(errmsg))
- while True:
- try:
- (pid, status) = os.waitpid(child_pid, 0)
- if os.WIFEXITED(status):
- result = os.WEXITSTATUS(status)
- if result != 255:
- errmsg = os.strerror(result)
- throw = lambda : __throw(IOError(result, errmsg))
- else:
- errmsg = "unexpected exception in child"
- else:
- result = -1
- errmsg = "child killed"
- break
- except OSError, ex:
- if ex.errno != errno.EINTR:
- os.close(recvsock)
- raise ex
- fcntl.fcntl(recvsock, fcntl.F_SETFL, os.O_NONBLOCK)
- try:
- (fd, errmsg) = passfdimpl.recvmsg(recvsock)
- except OSError, ex:
- if ex.errno != errno.EAGAIN:
- throw = lambda : __throw(ex)
- fd = 0
- os.close(recvsock)
- if not fd:
- throw()
+ def open(self, filename, mode = "r", bufsize = -1):