From bbfb6fc0956ef6bd4a86d198d1fa9378c27dba55 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Thu, 11 Jan 2018 19:30:37 +0100 Subject: [PATCH] [modules/battery] Ignore errors when reading status Reading status - similar to reading the capacity - might fail, just ignore that error. see #221 --- bumblebee/modules/battery.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bumblebee/modules/battery.py b/bumblebee/modules/battery.py index 7638d3f..57a12cc 100644 --- a/bumblebee/modules/battery.py +++ b/bumblebee/modules/battery.py @@ -107,6 +107,8 @@ class Module(bumblebee.engine.Module): charge = "" with open("{}/status".format(widget.name)) as f: charge = f.read().strip() + except IOError: + pass if charge == "Discharging": state.append("discharging-{}".format(min([10, 25, 50, 80, 100], key=lambda i: abs(i-capacity)))) else: