We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d44505f + dfa5573 commit 46c57b8Copy full SHA for 46c57b8
library/sensors/sensors_librehardwaremonitor.py
@@ -330,8 +330,13 @@ def swap_percent() -> float:
330
swap_used = virtual_mem_used - mem_used
331
swap_available = virtual_mem_available - mem_available
332
swap_total = swap_used + swap_available
333
+ try:
334
+ percent_swap = swap_used / swap_total * 100.0
335
+ except:
336
+ # No swap / pagefile disabled
337
+ percent_swap = 0.0
338
- return swap_used / swap_total * 100.0
339
+ return percent_swap
340
341
@staticmethod
342
def virtual_percent() -> float:
0 commit comments