1
mirror of https://github.com/home-assistant/core synced 2024-07-09 04:58:30 +02:00

error handling when writing

This commit is contained in:
Jon Maddox 2015-09-15 02:54:22 -04:00
parent c7565baa6d
commit acb288f9e7

View File

@ -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)