From 3d8c384bb74b806849217f8eb02ee67c3046c7bb Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Mon, 14 Sep 2015 11:03:54 +0100 Subject: [PATCH] cpufreq: handle non-integer output in get_available_frequencies --- wlauto/modules/cpufreq.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wlauto/modules/cpufreq.py b/wlauto/modules/cpufreq.py index 6a90b80c..17afd3cf 100644 --- a/wlauto/modules/cpufreq.py +++ b/wlauto/modules/cpufreq.py @@ -164,7 +164,13 @@ class CpufreqModule(Module): try: cmd = 'cat /sys/devices/system/cpu/{}/cpufreq/scaling_available_frequencies'.format(cpu) output = self.device.execute(cmd) - available_frequencies = map(int, output.strip().split()) # pylint: disable=E1103 + #available_frequencies = map(int, output.strip().split()) # pylint: disable=E1103 + available_frequencies = [] + for f in output.strip().split(): + try: + available_frequencies.append(int(f)) + except ValueError: + pass except DeviceError: # On some devices scaling_available_frequencies is not generated. # http://adrynalyne-teachtofish.blogspot.co.uk/2011/11/how-to-enable-scalingavailablefrequenci.html