changeset 129:580f0f4687c3

Fixed EINTR fatally breaking another poll() call on Python 2.6-
author Oleg Oshmyan <chortos@inbox.lv>
date Mon, 16 May 2011 21:42:43 +0100
parents 42c8f5c152a5
children 652028850ea4
files unix.py
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/unix.py	Mon May 16 21:31:43 2011 +0100
+++ b/unix.py	Mon May 16 21:42:43 2011 +0100
@@ -183,8 +183,15 @@
 					except SelectError:
 						if sys.exc_info()[1].args[0] != EINTR:
 							raise
-					if case.process.poll() is None:
-						raise testcases.WallTimeLimitExceeded
+					# subprocess in Python 2.6- is not guarded against EINTR
+					try:
+						if case.process.poll() is None:
+							raise testcases.WallTimeLimitExceeded
+					except OSError:
+						if sys.exc_info()[1].errno != EINTR:
+							raise
+						else:
+							case.process.poll()
 				else:
 					wait(case.process)
 			else: