Mercurial > ~astiob > upreckon > hgweb
diff unix.py @ 112:f0b63838f407 2.00
Fixed a crash due to SIGCHLD interrupting validator output pipe reads
author | Oleg Oshmyan <chortos@inbox.lv> |
---|---|
date | Fri, 08 Apr 2011 19:24:51 +0300 |
parents | 995502cdafc6 |
children | 16fe21d6582e |
line wrap: on
line diff
--- a/unix.py Fri Apr 08 19:22:19 2011 +0300 +++ b/unix.py Fri Apr 08 19:24:51 2011 +0300 @@ -112,6 +112,13 @@ except Exception: pass signal(SIGCHLD, bury_child) + class SignalIgnorer(object): + def __enter__(self): + signal(SIGCHLD, SIG_DFL) + def __exit__(self, exc_type, exc_value, traceback): + signal(SIGCHLD, bury_child) + signal_ignorer = SignalIgnorer() + __all__ += 'signal_ignorer', # If you want this to work portably, don't set any stdio argument to PIPE def call(*args, **kwargs):