mirror of
https://github.com/home-assistant/core
synced 2024-09-06 10:29:55 +02:00
error handling when writing
This commit is contained in:
parent
c7565baa6d
commit
acb288f9e7
@ -179,8 +179,12 @@ def install_osx():
|
|||||||
|
|
||||||
path = os.path.expanduser("~/Library/LaunchAgents/org.homeassistant.plist")
|
path = os.path.expanduser("~/Library/LaunchAgents/org.homeassistant.plist")
|
||||||
|
|
||||||
with open(path, 'w', encoding='utf-8') as outp:
|
try:
|
||||||
outp.write(plist)
|
with open(path, 'w', encoding='utf-8') as outp:
|
||||||
|
outp.write(plist)
|
||||||
|
except IOError as err:
|
||||||
|
print('Unable to write to ' + path, err)
|
||||||
|
return
|
||||||
|
|
||||||
os.popen('launchctl load -w -F ' + path)
|
os.popen('launchctl load -w -F ' + path)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user