From 6442bbe34db640230a9b4543cae0d3d0236da556 Mon Sep 17 00:00:00 2001 From: Phillip Berndt Date: Fri, 23 Jan 2015 07:54:04 +0100 Subject: [PATCH] Do not fail if no profile directory exists yet --- autorandr.py | 5 +++++ 1 file changed, 5 insertions(+) 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) -- 2.39.5