From: Phillip Berndt Date: Fri, 23 Jan 2015 06:54:04 +0000 (+0100) Subject: Do not fail if no profile directory exists yet X-Git-Tag: 1.0~94 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6442bbe34db640230a9b4543cae0d3d0236da556;p=deb_pkgs%2Fautorandr.git Do not fail if no profile directory exists yet --- diff --git a/autorandr.py b/autorandr.py index 01632ee..da1abee 100755 --- a/autorandr.py +++ b/autorandr.py @@ -483,6 +483,11 @@ def main(argv): try: profiles = load_profiles(profile_path) + except OSError as e: + if e.errno == 2: # No such file or directory + profiles = {} + else: + raise e except Exception as e: print("Failed to load profiles:\n%s" % str(e), file=sys.stderr) sys.exit(1)