Skip to content

Commit

Permalink
raise PIDFileError on empty PID file, not ValueError in baseapp
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Jun 18, 2011
1 parent a37acaa commit 371b30f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion IPython/parallel/apps/baseapp.py
Expand Up @@ -230,7 +230,11 @@ def get_pid_from_file(self):
pid_file = os.path.join(self.profile_dir.pid_dir, self.name + u'.pid')
if os.path.isfile(pid_file):
with open(pid_file, 'r') as f:
pid = int(f.read().strip())
s = f.read().strip()
try:
pid = int(s)
except:
raise PIDFileError("invalid pid file: %s (contents: %r)"%(pid_file, s))
return pid
else:
raise PIDFileError('pid file not found: %s' % pid_file)
Expand Down

0 comments on commit 371b30f

Please sign in to comment.