Skip to content

Commit

Permalink
Fix TypeError preventing script to launch
Browse files Browse the repository at this point in the history
TypeError: argument should be integer or bytes-like object, not 'str'
  • Loading branch information
melvinmajor committed Oct 21, 2020
1 parent 7e6bdd0 commit 056049e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/compensated-temperature.py
Expand Up @@ -32,7 +32,7 @@
def get_cpu_temperature():
process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE)
output, _error = process.communicate()
return float(output[output.index('=') + 1:output.rindex("'")])
return float(output[output.index(ord('=')) + 1:output.rindex(ord("'"))])


factor = 1.0 # Smaller numbers adjust temp down, vice versa
Expand Down

0 comments on commit 056049e

Please sign in to comment.