Don't crash if pid creation fails. Fixes #482

This commit is contained in:
Clinton Hall 2014-07-13 07:03:51 +09:30
commit 6df93c16a1

View file

@ -1005,9 +1005,11 @@ class PosixProcess():
if not self.lasterror: if not self.lasterror:
# Write my pid into pidFile to keep multiple copies of program from running # Write my pid into pidFile to keep multiple copies of program from running
try:
fp = open(self.pidpath, 'w') fp = open(self.pidpath, 'w')
fp.write(str(os.getpid())) fp.write(str(os.getpid()))
fp.close() fp.close()
except: pass
return self.lasterror return self.lasterror