summaryrefslogtreecommitdiff
path: root/psutil/_pslinux.py
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-02-03 20:11:50 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2017-02-03 20:11:50 +0100
commit4d219e1349187553245c9ec57d9a2fb6923d601e (patch)
tree9262caa517f34ae51cbf8fdd39d0c4e6defd05fc /psutil/_pslinux.py
parentbb3cc6035bccc04dea7f98ce5e0bba113cb677ac (diff)
parent0db4ec677d0812a63bdc841558077c36a96412f3 (diff)
downloadpsutil-release-5.1.2.tar.gz
Merge branch 'master' of github.com:giampaolo/psutilrelease-5.1.2
Diffstat (limited to 'psutil/_pslinux.py')
-rw-r--r--psutil/_pslinux.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py
index beddb8b6..8fc0bb6d 100644
--- a/psutil/_pslinux.py
+++ b/psutil/_pslinux.py
@@ -1143,8 +1143,8 @@ def sensors_battery():
except ZeroDivisionError:
percent = 0.0
else:
- percent = int(cat(root + "/capacity", fallback=null))
- if percent == null:
+ percent = int(cat(root + "/capacity", fallback=-1))
+ if percent == -1:
return None
# Is AC power cable plugged in?