Facundo Batista <facundobatista at gmail.com> wrote: > errpipe_read, errpipe_write = os.pipe() > try: > try: > ..... > ..... > ..... > ..... > ..... > ..... > finally: > os.close(errpipe_write) > ..... > ..... > ..... > finally: > os.close(errpipe_read) > > I just don't like a huge try/finally... but as FDs are just ints, do > you think is there a better way to handle it? I use a convenience function like this, so that GC takes care of the FDs: def make_pipe(): read_fd, write_fd = os.pipe() return os.fdopen(read_fd, "r"), os.fdopen(write_fd, "w") Mark
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4