make capacity fault-proof
authorRonny Strutz <ronny.strutz@multimedia-labs.de>
Mon, 29 Aug 2005 22:08:33 +0000 (22:08 +0000)
committerRonny Strutz <ronny.strutz@multimedia-labs.de>
Mon, 29 Aug 2005 22:08:33 +0000 (22:08 +0000)
lib/python/Components/Harddisk.py

index a09073b..c5ba134 100644 (file)
@@ -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")