(self, fd)
| 45 | class DupFd(object): |
| 46 | '''Wrapper for fd which can be used at any time.''' |
| 47 | def __init__(self, fd): |
| 48 | new_fd = os.dup(fd) |
| 49 | def send(conn, pid): |
| 50 | reduction.send_handle(conn, new_fd, pid) |
| 51 | def close(): |
| 52 | os.close(new_fd) |
| 53 | self._id = _resource_sharer.register(send, close) |
| 54 | |
| 55 | def detach(self): |
| 56 | '''Get the fd. This should only be called once.''' |