##// END OF EJS Templates
raise PIDFileError on empty PID file, not ValueError in baseapp
MinRK -
Show More
@@ -230,7 +230,11 b' class BaseParallelApplication(BaseIPythonApplication):'
230 pid_file = os.path.join(self.profile_dir.pid_dir, self.name + u'.pid')
230 pid_file = os.path.join(self.profile_dir.pid_dir, self.name + u'.pid')
231 if os.path.isfile(pid_file):
231 if os.path.isfile(pid_file):
232 with open(pid_file, 'r') as f:
232 with open(pid_file, 'r') as f:
233 pid = int(f.read().strip())
233 s = f.read().strip()
234 try:
235 pid = int(s)
236 except:
237 raise PIDFileError("invalid pid file: %s (contents: %r)"%(pid_file, s))
234 return pid
238 return pid
235 else:
239 else:
236 raise PIDFileError('pid file not found: %s' % pid_file)
240 raise PIDFileError('pid file not found: %s' % pid_file)
General Comments 0
You need to be logged in to leave comments. Login now