Mercurial > ~astiob > upreckon > hgweb
comparison testcases.py @ 128:42c8f5c152a5
Fixed EINTR fatally breaking poll/wait on Python 2.6- (for real this time)
author | Oleg Oshmyan <chortos@inbox.lv> |
---|---|
date | Mon, 16 May 2011 21:31:43 +0100 |
parents | 218b8c28549c |
children | 652028850ea4 |
comparison
equal
deleted
inserted
replaced
127:f5b8a0c0e3cb | 128:42c8f5c152a5 |
---|---|
194 for i in range(3): | 194 for i in range(3): |
195 try: | 195 try: |
196 terminate(case.process) | 196 terminate(case.process) |
197 except Exception: | 197 except Exception: |
198 time.sleep(0) | 198 time.sleep(0) |
199 case.process.poll() | |
200 else: | 199 else: |
201 case.process.wait() | 200 wait(case.process) |
202 break | 201 break |
203 else: | 202 else: |
204 # If killing the process is unsuccessful three times in a row, | 203 # If killing the process is unsuccessful three times in a row, |
205 # just silently stop trying | 204 # just silently stop trying |
206 for i in range(3): | 205 for i in range(3): |
207 try: | 206 try: |
208 kill(case.process) | 207 kill(case.process) |
209 except Exception: | 208 except Exception: |
210 time.sleep(0) | 209 time.sleep(0) |
211 case.process.poll() | |
212 else: | 210 else: |
213 case.process.wait() | 211 wait(case.process) |
214 break | 212 break |
215 if case.files_to_delete: | 213 if case.files_to_delete: |
216 for name in case.files_to_delete: | 214 for name in case.files_to_delete: |
217 try: | 215 try: |
218 os.remove(name) | 216 os.remove(name) |