(conn)
| 1171 | reduction.register(Connection, reduce_connection) |
| 1172 | |
| 1173 | def reduce_pipe_connection(conn): |
| 1174 | access = ((_winapi.FILE_GENERIC_READ if conn.readable else 0) | |
| 1175 | (_winapi.FILE_GENERIC_WRITE if conn.writable else 0)) |
| 1176 | dh = reduction.DupHandle(conn.fileno(), access) |
| 1177 | return rebuild_pipe_connection, (dh, conn.readable, conn.writable) |
| 1178 | def rebuild_pipe_connection(dh, readable, writable): |
| 1179 | handle = dh.detach() |
| 1180 | return PipeConnection(handle, readable, writable) |