Skip to content
Snippets Groups Projects
Commit 95c672c0 authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

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
parent afcad425
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment