]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/commitdiff
Do not fail if no profile directory exists yet
authorPhillip Berndt <phillip.berndt@googlemail.com>
Fri, 23 Jan 2015 06:54:04 +0000 (07:54 +0100)
committerPhillip Berndt <phillip.berndt@googlemail.com>
Fri, 23 Jan 2015 06:54:04 +0000 (07:54 +0100)
autorandr.py

index 01632ee86e1f329e0ec74ca82ae24943a36c0423..da1abee6f625ea6533e16afceeae3188e17607f6 100755 (executable)
@@ -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)