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:
Brijesh Bittu 2015-07-09 10:38:14 +05:30
parent 80e93b9c55
commit 68a944088e

View File

@ -67,11 +67,8 @@ class Pidfile(object):
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: