deal with xbacklight returning an error code
authorRalf Jung <post@ralfj.de>
Tue, 3 Feb 2015 18:59:48 +0000 (19:59 +0100)
committerRalf Jung <post@ralfj.de>
Tue, 3 Feb 2015 18:59:48 +0000 (19:59 +0100)
dsl.py

diff --git a/dsl.py b/dsl.py
index 2b677bf4fd44456af3de9be81e67c467a460f061..707a5c008cf2d85172879d289046cc29d5563550 100755 (executable)
--- a/dsl.py
+++ b/dsl.py
@@ -264,6 +264,8 @@ if __name__ == "__main__":
                     subprocess.check_call(["xbacklight", "-set", "100"])
             except FileNotFoundError:
                 print("xbacklight has not been found, unable to turn your laptop backlight on.")
                     subprocess.check_call(["xbacklight", "-set", "100"])
             except FileNotFoundError:
                 print("xbacklight has not been found, unable to turn your laptop backlight on.")
+            except subprocess.CalledProcessError:
+                print("xbacklight returned an error while attempting to turn your laptop backlight on.")
     except Exception as e:
         frontend.error(str(e))
         raise
     except Exception as e:
         frontend.error(str(e))
         raise