testing all examples, with corrections for Python3 support
[EVA-2020-02-2.git] / examples / luftdaten.py
index 4d3d49acd87a86dae17d79f51981f67d75fc261a..c5b03873356bbdca7a808ab0f29729e6f4b88501 100755 (executable)
@@ -71,7 +71,7 @@ def read_values():
 
 # Get CPU temperature to use for compensation
 def get_cpu_temperature():
-    process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE)
+    process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE, universal_newlines=True)
     output, _error = process.communicate()
     return float(output[output.index('=') + 1:output.rindex("'")])