aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/Harddisk.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/python/Components/Harddisk.py b/lib/python/Components/Harddisk.py
index a09073ba..c5ba1344 100644
--- a/lib/python/Components/Harddisk.py
+++ b/lib/python/Components/Harddisk.py
@@ -22,10 +22,12 @@ class Harddisk:
line = procfile.readline()
procfile.close()
- if line == "":
+ try:
+ cap = int(line)
+ except:
return -1
-
- return int(line)
+
+ return cap
def model(self):
procfile = tryOpen(self.prochdx + "model")