diff options
| author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-02-03 13:08:07 +0100 |
|---|---|---|
| committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-02-03 13:08:07 +0100 |
| commit | fef8ef01f016b2fbc7e89ebbf02b2da964ca466c (patch) | |
| tree | 8bae6d35877026417c8661064c918dcbc99b0d1f /psutil/_pslinux.py | |
| parent | 9ad0590f4d801cfbb0224da33127dc56dbd55130 (diff) | |
| download | psutil-fef8ef01f016b2fbc7e89ebbf02b2da964ca466c.tar.gz | |
be more cautious when converting to int()
Diffstat (limited to 'psutil/_pslinux.py')
| -rw-r--r-- | psutil/_pslinux.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index 82cdb2d3..1183052b 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -1114,7 +1114,7 @@ def sensors_battery(): for path in paths: ret = cat(path, fallback=null) if ret != null: - return int(ret) + return int(ret) if ret.isdigit() else ret return None root = os.path.join(POWER_SUPPLY_PATH, "BAT0") |
