]> granicus.if.org Git - python/commitdiff
(backport from trunk r64756)
authorGregory P. Smith <greg@mad-scientist.com>
Mon, 4 Aug 2008 03:23:25 +0000 (03:23 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Mon, 4 Aug 2008 03:23:25 +0000 (03:23 +0000)
Issue #2113: Fix error in subprocess.Popen if the select system call is
interrupted by a signal.

Lib/subprocess.py
Misc/NEWS

index 046f80ca6f88d9515fc307c3650dbdefcc9351dc..80be0873301c5389315e791ef059e6e0414ea66d 100644 (file)
@@ -1153,7 +1153,12 @@ class Popen(object):
 
             input_offset = 0
             while read_set or write_set:
-                rlist, wlist, xlist = select.select(read_set, write_set, [])
+                try:
+                    rlist, wlist, xlist = select.select(read_set, write_set, [])
+                except select.error, e:
+                    if e.args[0] == errno.EINTR:
+                        continue
+                    raise
 
                 if self.stdin in wlist:
                     # When select has indicated that the file is writable,
index 603e84711ebf7b6449cec8bff039da2ae7151798..47cb3ef110a0ed7a1e62d3b18dad6365ae07a9d3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -130,6 +130,10 @@ Library
   argument in python 2.5, this broke code that subclassed Popen to include its
   own poll method.  Fixed my moving _deadstate to an _internal_poll method.
 
+- Issue #2113: Fix error in subprocess.Popen if the select system call is
+  interrupted by a signal.
+
+
 Extension Modules
 -----------------