mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Update pidfile.py
Return directly in the `except` instead of checking again for zero (as suggested by @benoitc and @tilgovi)
This commit is contained in:
parent
80e93b9c55
commit
68a944088e
@ -67,11 +67,8 @@ class Pidfile(object):
|
|||||||
try:
|
try:
|
||||||
with open(self.fname, "r") as f:
|
with open(self.fname, "r") as f:
|
||||||
try:
|
try:
|
||||||
wpid = int(f.read())
|
wpid = int(f.read() or 0)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
wpid = 0
|
|
||||||
|
|
||||||
if wpid <= 0:
|
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user