mirror of
https://github.com/home-assistant/core.git
synced 2025-08-15 02:21:40 +02:00
error handling when writing
This commit is contained in:
@@ -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)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user