# HG changeset patch # User Martin von Zweigbergk # Date 1593068783 25200 # Node ID 95c672c071164f3d66ded8a717183d30f38942a6 # Parent afcad425a0b679b3de56f2aa4b49858dc9c366c0 procutil: make recent fix for zombies compatible with py2 The fix in ed684a82e29b (procutil: always waiting on child processes to prevent zombies with 'hg serve', 2020-05-07) works only on Python 3 because it passes a `daemon` argument to `threading.Thread()`. Python 2 requires you to assign to the `.daemon` property instead. Python 3 also seems to support that, so this patch fixes the code by unconditionally using the old form. Differential Revision: https://phab.mercurial-scm.org/D8657 diff -r afcad425a0b6 -r 95c672c07116 mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py Wed Jun 24 04:25:34 2020 +0200 +++ b/mercurial/utils/procutil.py Thu Jun 25 00:06:23 2020 -0700 @@ -615,7 +615,9 @@ def _do_wait(): os.waitpid(pid, 0) - threading.Thread(target=_do_wait, daemon=True).start() + t = threading.Thread(target=_do_wait) + t.daemon = True + t.start() return # Parent process (_pid, status) = os.waitpid(pid, 0)