##// END OF EJS Templates
Fixing command finding bug on Win32 in ipcluster.py
Administrator -
Show More
@@ -42,8 +42,11 b' def find_exe(cmd):'
42 except ImportError:
42 except ImportError:
43 raise ImportError('you need to have pywin32 installed for this to work')
43 raise ImportError('you need to have pywin32 installed for this to work')
44 else:
44 else:
45 (path, offest) = win32api.SearchPath(os.environ['PATH'],cmd)
45 try:
46 return path
46 (path, offest) = win32api.SearchPath(os.environ['PATH'],cmd + '.exe')
47 except:
48 (path, offset) = win32api.SearchPath(os.environ['PATH'],cmd + '.bat')
49 return path
47
50
48 class ProcessStateError(Exception):
51 class ProcessStateError(Exception):
49 pass
52 pass
@@ -171,7 +174,7 b' class ControllerLauncher(ProcessLauncher):'
171
174
172 def __init__(self, extra_args=None):
175 def __init__(self, extra_args=None):
173 if sys.platform == 'win32':
176 if sys.platform == 'win32':
174 args = [find_exe('ipcontroller.bat')]
177 args = [find_exe('ipcontroller')]
175 else:
178 else:
176 args = ['ipcontroller']
179 args = ['ipcontroller']
177 self.extra_args = extra_args
180 self.extra_args = extra_args
@@ -185,7 +188,7 b' class EngineLauncher(ProcessLauncher):'
185
188
186 def __init__(self, extra_args=None):
189 def __init__(self, extra_args=None):
187 if sys.platform == 'win32':
190 if sys.platform == 'win32':
188 args = [find_exe('ipengine.bat')]
191 args = [find_exe('ipengine')]
189 else:
192 else:
190 args = ['ipengine']
193 args = ['ipengine']
191 self.extra_args = extra_args
194 self.extra_args = extra_args
General Comments 0
You need to be logged in to leave comments. Login now