##// END OF EJS Templates
Try to catter for exception in corner cases with some version of windows...
gvaroquaux -
Show More
@@ -50,7 +50,6 b' import subprocess'
50 from subprocess import PIPE
50 from subprocess import PIPE
51 import sys
51 import sys
52 import os
52 import os
53 import time
54 import types
53 import types
55
54
56 try:
55 try:
@@ -69,8 +68,19 b' except ImportError:'
69
68
70 mswindows = (sys.platform == "win32")
69 mswindows = (sys.platform == "win32")
71
70
71 skip = False
72
72 if mswindows:
73 if mswindows:
73 import winprocess
74 # Some versions of windows, in some strange corner cases, give
75 # errror with the killableprocess.
76 if sys.version_info[:2] > (2, 4):
77 import platform
78 if platform.uname()[3] == '' or platform.uname()[3] > '6.0.6000':
79 skip = True
80 else:
81 import winprocess
82 else:
83 skip = True
74 else:
84 else:
75 import signal
85 import signal
76
86
@@ -78,7 +88,11 b' if not mswindows:'
78 def DoNothing(*args):
88 def DoNothing(*args):
79 pass
89 pass
80
90
81 class Popen(subprocess.Popen):
91
92 if skip:
93 Popen = subprocess.Popen
94 else:
95 class Popen(subprocess.Popen):
82 if not mswindows:
96 if not mswindows:
83 # Override __init__ to set a preexec_fn
97 # Override __init__ to set a preexec_fn
84 def __init__(self, *args, **kwargs):
98 def __init__(self, *args, **kwargs):
General Comments 0
You need to be logged in to leave comments. Login now