mirror of
https://github.com/home-assistant/core.git
synced 2025-04-26 18:27:51 +00:00
Fixed signal binding exception
Cleanly handle error for failed SIGQUIT binding. This can happen when running in a thread.
This commit is contained in:
parent
18569104fa
commit
e7caac212d
@ -82,7 +82,11 @@ class HomeAssistant(object):
|
|||||||
DOMAIN, SERVICE_HOMEASSISTANT_STOP, stop_homeassistant)
|
DOMAIN, SERVICE_HOMEASSISTANT_STOP, stop_homeassistant)
|
||||||
|
|
||||||
if os.name != "nt":
|
if os.name != "nt":
|
||||||
|
try:
|
||||||
signal.signal(signal.SIGQUIT, stop_homeassistant)
|
signal.signal(signal.SIGQUIT, stop_homeassistant)
|
||||||
|
except ValueError:
|
||||||
|
_LOGGER.warning(
|
||||||
|
'Could not bind to SIGQUIT. Are you running in a thread?')
|
||||||
|
|
||||||
while not request_shutdown.isSet():
|
while not request_shutdown.isSet():
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user