Skip to content

Commit

Permalink
Update pidfile.py
Browse files Browse the repository at this point in the history
Return directly in the `except` instead of checking again for zero (as suggested by @benoitc and @tilgovi)
  • Loading branch information
brijeshb42 committed Jul 9, 2015
1 parent 80e93b9 commit 68a9440
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions gunicorn/pidfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,8 @@ def validate(self):
try:
with open(self.fname, "r") as f:
try:
wpid = int(f.read())
wpid = int(f.read() or 0)
except ValueError:
wpid = 0

if wpid <= 0:
return

try:
Expand Down

0 comments on commit 68a9440

Please sign in to comment.