comparison unix.py @ 108:218b8c28549c

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
comparison
equal deleted inserted replaced
107:6589511f5418 108:218b8c28549c
110 try: 110 try:
111 bury_child.case.time_stopped = clock() 111 bury_child.case.time_stopped = clock()
112 except Exception: 112 except Exception:
113 pass 113 pass
114 signal(SIGCHLD, bury_child) 114 signal(SIGCHLD, bury_child)
115 class SignalIgnorer(object):
116 def __enter__(self):
117 signal(SIGCHLD, SIG_DFL)
118 def __exit__(self, exc_type, exc_value, traceback):
119 signal(SIGCHLD, bury_child)
120 signal_ignorer = SignalIgnorer()
121 __all__ += 'signal_ignorer',
115 122
116 # If you want this to work portably, don't set any stdio argument to PIPE 123 # If you want this to work portably, don't set any stdio argument to PIPE
117 def call(*args, **kwargs): 124 def call(*args, **kwargs):
118 global last_rusage 125 global last_rusage
119 bury_child.case = case = kwargs.pop('case') 126 bury_child.case = case = kwargs.pop('case')