mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +00: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")
|
||||
|
||||
with open(path, 'w', encoding='utf-8') as outp:
|
||||
outp.write(plist)
|
||||
try:
|
||||
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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user