forked from fedora-python/python26
-
Notifications
You must be signed in to change notification settings - Fork 0
/
python-2.6.6-fix-subprocess-timeout.patch
39 lines (33 loc) · 1.24 KB
/
python-2.6.6-fix-subprocess-timeout.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- Python-2.6.6/Lib/subprocess.py.orig 2013-05-07 10:45:13.000000000 +0200
+++ Python-2.6.6/Lib/subprocess.py 2013-05-07 11:05:59.570216088 +0200
@@ -477,7 +477,10 @@
timeout = kwargs.pop('timeout', None)
p = Popen(*popenargs, **kwargs)
try:
- return p.wait(timeout=timeout)
+ if timeout == None:
+ return p.wait()
+ else:
+ return p.wait(timeout=timeout)
except TimeoutExpired:
p.kill()
p.wait()
@@ -746,7 +749,10 @@
if stderr:
stderr = self._translate_newlines(stderr)
- sts = self.wait(timeout=self._remaining_time(endtime))
+ if timeout == None:
+ sts = self.wait()
+ else:
+ sts = self.wait(timeout=self._remaining_time(endtime))
return (stdout, stderr)
@@ -1327,7 +1333,11 @@
if stderr:
stderr = self._translate_newlines(stderr)
- self.wait(timeout=self._remaining_time(endtime))
+ # if timeout == None in calling function, we get endtime == None
+ if endtime == None:
+ self.wait()
+ else:
+ self.wait(timeout=self._remaining_time(endtime))
return (stdout, stderr)