diff options
author | Thomas Moreau <thomas.moreau.2010@gmail.com> | 2019-05-20 19:37:05 (GMT) |
---|---|---|
committer | Antoine Pitrou <antoine@python.org> | 2019-05-20 19:37:05 (GMT) |
commit | c09a9f56c08d80567454cae6f78f738a89e1ae94 (patch) | |
tree | 7f00233cfa994ba74ca952d371ae85651690602a /Lib/multiprocessing/util.py | |
parent | 5ae1c84bcd13b766989fc3f1e1c851e7bd4c1faa (diff) | |
download | cpython-c09a9f56c08d80567454cae6f78f738a89e1ae94.zip cpython-c09a9f56c08d80567454cae6f78f738a89e1ae94.tar.gz cpython-c09a9f56c08d80567454cae6f78f738a89e1ae94.tar.bz2 |
bpo-36888: Add multiprocessing.parent_process() (GH-13247)
Diffstat (limited to 'Lib/multiprocessing/util.py')
-rw-r--r-- | Lib/multiprocessing/util.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/multiprocessing/util.py b/Lib/multiprocessing/util.py index 0c4eb24..5674ad7 100644 --- a/Lib/multiprocessing/util.py +++ b/Lib/multiprocessing/util.py @@ -421,3 +421,9 @@ def spawnv_passfds(path, args, passfds): finally: os.close(errpipe_read) os.close(errpipe_write) + + +def close_fds(*fds): + """Close each file descriptor given as an argument""" + for fd in fds: + os.close(fd) |