Correct exception generated when no service pack is present

This commit is contained in:
Dionisio E Alonso 2015-04-08 11:57:56 -03:00
parent 8b23c6d977
commit 0203e53bd9
1 changed files with 4 additions and 2 deletions

View File

@ -33,7 +33,6 @@ class SystemInformation:
for part in self._disk_c():
hdd.append('{} {:.2f}GB free'.format(part[0], part[1]/(1024**3)))
self.hdFree = 'HDD:\t{}'.format(', '.join(hdd))
# self.hdFree = 'HDD:\t{:.2f}GB free'.format(self._disk_c()/(1024**3))
self.os = 'OS:\t{}'.format(self._os_version())
def _cpu(self):
@ -115,7 +114,10 @@ class SystemInformation:
try:
sp = get('CSDVersion')
except:
sp = get('CSDBuildNumber')
try:
sp = 'n' + get('CSDBuildNumber')
except:
sp = '(no service pack found)'
build = get('CurrentBuildNumber')
return '{} {} (build {})'.format(os, sp, build)