1
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:
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") 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)