From: Ronny Strutz Date: Mon, 29 Aug 2005 22:08:33 +0000 (+0000) Subject: make capacity fault-proof X-Git-Tag: 2.6.0~5709 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/bc5fff23f0b5e52e67fa6df82506320523b6771a make capacity fault-proof --- 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")