提交 cef35eb2 编写于 作者: N nicolargo

Crash on launch when viewing temperature of laptop HDD in sleep mode #824

上级 edb9eedf
...@@ -5,7 +5,9 @@ Glances Version 2 ...@@ -5,7 +5,9 @@ Glances Version 2
Version 2.7 Version 2.7
=========== ===========
* ... Bugs corrected:
* Crash on launch when viewing temperature of laptop HDD in sleep mode (issue #824)
Version 2.6.1 Version 2.6.1
============= =============
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
import os import os
import socket import socket
import numbers
from glances.compat import nativestr, range from glances.compat import nativestr, range
from glances.logger import logger from glances.logger import logger
...@@ -119,7 +120,8 @@ class GlancesGrabHDDTemp(object): ...@@ -119,7 +120,8 @@ class GlancesGrabHDDTemp(object):
temperature = fields[offset + 3] temperature = fields[offset + 3]
unit = nativestr(fields[offset + 4]) unit = nativestr(fields[offset + 4])
hddtemp_current['label'] = device hddtemp_current['label'] = device
hddtemp_current['value'] = float(temperature) if temperature != b'ERR' else temperature # Temperature could be 'ERR' or 'SLP' (see issue#824)
hddtemp_current['value'] = float(temperature) if isinstance(temperature, numbers.Number) else temperature
hddtemp_current['unit'] = unit hddtemp_current['unit'] = unit
self.hddtemp_list.append(hddtemp_current) self.hddtemp_list.append(hddtemp_current)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册