Updated gunicorn/pidfile.py

Added a try block to convert the contents of the `pidfile.py` if it can be converted to integer or not. If not, then `wpid` is assigned 0 and the `validate` function returns as usual. If the pidfile has a valid int, the function continues to kill the process as before.
This commit is contained in:
Brijesh Bittu 2015-06-04 12:48:03 +05:30
parent 5a8b9555da
commit 80e93b9c55

View File

@ -66,7 +66,10 @@ class Pidfile(object):
return
try:
with open(self.fname, "r") as f:
wpid = int(f.read() or 0)
try:
wpid = int(f.read())
except ValueError:
wpid = 0
if wpid <= 0:
return