Make sure we don't try to read when opening a file in binary more. Fixes #1301.

This commit is contained in:
grossmj
2018-03-07 16:39:04 +07:00
parent 419797dd92
commit c93d0d8d12
8 changed files with 36 additions and 26 deletions

View File

@ -160,7 +160,7 @@ def pid_lock(path):
with open(path) as f:
try:
pid = int(f.read())
os.kill(pid, 0) # If the proces is not running kill return an error
os.kill(pid, 0) # kill returns an error if the process is not running
except (OSError, SystemError, ValueError):
pid = None
except OSError as e: