reload: Fix error if pidof not installed

This commit is contained in:
Dylan Araps 2019-02-02 21:07:28 +02:00
parent 984c7b640e
commit f88dca706f
No known key found for this signature in database
GPG Key ID: F635E931C2834999

View File

@ -5,6 +5,7 @@ import colorsys
import json
import logging
import os
import shutil
import subprocess
import sys
@ -178,6 +179,9 @@ def disown(cmd):
def get_pid(name):
"""Check if process is running by name."""
if not shutil.which("pidof"):
return False
try:
subprocess.check_output(["pidof", "-s", name])
except subprocess.CalledProcessError: