From 5f96b603a889c632c896bc6a904f595bbd92cbe1 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Thu, 11 Jan 2018 20:26:49 +0100 Subject: [PATCH] [modules/battery] fix syntax error see #221 --- bumblebee/modules/battery.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bumblebee/modules/battery.py b/bumblebee/modules/battery.py index 57a12cc..5367d5f 100644 --- a/bumblebee/modules/battery.py +++ b/bumblebee/modules/battery.py @@ -105,8 +105,9 @@ class Module(bumblebee.engine.Module): state.append("AC") else: charge = "" - with open("{}/status".format(widget.name)) as f: - charge = f.read().strip() + try: + with open("{}/status".format(widget.name)) as f: + charge = f.read().strip() except IOError: pass if charge == "Discharging":