summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-02-03 13:08:07 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2017-02-03 13:08:07 +0100
commitfef8ef01f016b2fbc7e89ebbf02b2da964ca466c (patch)
tree8bae6d35877026417c8661064c918dcbc99b0d1f
parent9ad0590f4d801cfbb0224da33127dc56dbd55130 (diff)
downloadpsutil-fef8ef01f016b2fbc7e89ebbf02b2da964ca466c.tar.gz
be more cautious when converting to int()
-rw-r--r--psutil/__init__.py2
-rw-r--r--psutil/_pslinux.py2
-rwxr-xr-xscripts/internal/download_exes.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/psutil/__init__.py b/psutil/__init__.py
index a879e0dc..511fdacf 100644
--- a/psutil/__init__.py
+++ b/psutil/__init__.py
@@ -192,7 +192,7 @@ __all__ = [
]
__all__.extend(_psplatform.__extra__all__)
__author__ = "Giampaolo Rodola'"
-__version__ = "5.1.1"
+__version__ = "5.1.2"
version_info = tuple([int(num) for num in __version__.split('.')])
AF_LINK = _psplatform.AF_LINK
POWER_TIME_UNLIMITED = _common.POWER_TIME_UNLIMITED
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")
diff --git a/scripts/internal/download_exes.py b/scripts/internal/download_exes.py
index 2a40168c..d8d2768b 100755
--- a/scripts/internal/download_exes.py
+++ b/scripts/internal/download_exes.py
@@ -27,7 +27,7 @@ from psutil import __version__ as PSUTIL_VERSION
BASE_URL = 'https://ci.appveyor.com/api'
-PY_VERSIONS = ['2.7', '3.3', '3.4', '3.5']
+PY_VERSIONS = ['2.7', '3.3', '3.4', '3.5', '3.6']
def exit(msg):