Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: fix int division by bytes #1922

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ XXXX-XX-XX
called after sprintf(). (patch by alxchk)
- 1874_: [Solaris] swap output error due to incorrect range.
- 1913_: [Linux] wait_procs seemingly ignoring timeout, TimeoutExpired thrown
- 1919_: [Linux] On Librem5 psutil crash, fix int division by bytes

5.8.0
=====
Expand Down
2 changes: 1 addition & 1 deletion psutil/_pslinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ def multi_cat(*paths):
secsleft = _common.POWER_TIME_UNLIMITED
elif energy_now is not None and power_now is not None:
try:
secsleft = int(energy_now / power_now * 3600)
secsleft = int(int(energy_now) / int(power_now) * 3600)
except ZeroDivisionError:
secsleft = _common.POWER_TIME_UNKNOWN
elif time_to_empty is not None:
Expand Down