From dc3db49c5a24ed5b251d4a4a7a0d5e37549e8af3 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 4 Nov 2018 02:35:56 +0000 Subject: [PATCH] issue #406: more leaked FDs when create_child() fails. --- mitogen/parent.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mitogen/parent.py b/mitogen/parent.py index f2dacb09..556f38c6 100644 --- a/mitogen/parent.py +++ b/mitogen/parent.py @@ -285,6 +285,9 @@ def create_child(args, merge_stdio=False, stderr_pipe=False, preexec_fn=None): except Exception: childfp.close() parentfp.close() + if stderr_pipe: + os.close(stderr_r) + os.close(stderr_w) raise if stderr_pipe: