From 30e6dd97fae4b7f64f8e20fa87bdf9b3eb1b179c Mon Sep 17 00:00:00 2001 From: ha7ilm Date: Thu, 31 Mar 2016 10:08:08 +0200 Subject: [PATCH] get_cpu_usage workaround for Mac --- openwebrx.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openwebrx.py b/openwebrx.py index d9b661e..1625381 100755 --- a/openwebrx.py +++ b/openwebrx.py @@ -617,7 +617,10 @@ last_idletime=0 def get_cpu_usage(): global last_worktime, last_idletime - f=open("/proc/stat","r") + try: + f=open("/proc/stat","r") + except: + return 0 #Workaround, possibly we're on a Mac line="" while not "cpu " in line: line=f.readline() f.close()