Skip to content

Commit

Permalink
run_script: fix PID file checking logic when the file is empty
Browse files Browse the repository at this point in the history
This fixes issue #1075

I don't know why the elif explicitly negated the previous codnition, it's
obviously not needed because else if already implies the previous
condition is False.

Also, whoever added the parenthesis there messed up the logic even further,
before they were there, it worked okay, even if the condition was a bit
more verbose than logically needed. Well, that's what you get when you
blindly try to make code conform to PEP8 without actually reading it.
  • Loading branch information
Elad Alfassa committed Jun 22, 2016
1 parent c10b388 commit 274af02
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sopel/run_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ def main(argv=None):
else:
os.kill(old_pid, signal.SIGTERM)
sys.exit(0)
elif old_pid is None or (not tools.check_pid(old_pid)
and (opts.kill or opts.quit)):
elif opts.kill or opts.quit:
stderr('Sopel is not running!')
sys.exit(1)
elif opts.quit or opts.kill:
Expand Down

0 comments on commit 274af02

Please sign in to comment.