diff options
Diffstat (limited to 'psutil/tests/test_sunos.py')
-rwxr-xr-x | psutil/tests/test_sunos.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/psutil/tests/test_sunos.py b/psutil/tests/test_sunos.py index dd74a49b..274584d6 100755 --- a/psutil/tests/test_sunos.py +++ b/psutil/tests/test_sunos.py @@ -25,10 +25,9 @@ class SunOSSpecificTestCase(PsutilTestCase): raise ValueError('no swap device(s) configured') total = free = 0 for line in lines: - line = line.split() - t, f = line[-2:] - total += int(int(t) * 512) - free += int(int(f) * 512) + fields = line.split() + total = int(fields[3]) * 512 + free = int(fields[4]) * 512 used = total - free psutil_swap = psutil.swap_memory() |