Skip to content

Commit

Permalink
Fix psutil.virtual_memory() type mismatch for NetBSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
khanzf committed Jun 3, 2016
1 parent 1811fd9 commit e98db38
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -382,3 +382,7 @@ D: sample code for process USS memory.
N: wxwright
W: https://github.com/wxwright
I: 776

N: Farhan Khan
E: khanzf@gmail.com
I: 823
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Bug tracker at https://github.com/giampaolo/psutil/issues
==================

- #812: [NetBSD] fix compilation on NetBSD-5.x.
- #823: [NetBSD] virtual_memory() raises TypeError on Python 3.


4.2.0 - 2016-05-14
Expand Down
4 changes: 2 additions & 2 deletions psutil/_psbsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ def virtual_memory():
# The C ext set them to 0.
with open('/proc/meminfo', 'rb') as f:
for line in f:
if line.startswith("Buffers:"):
if line.startswith(b'Buffers:'):
buffers = int(line.split()[1]) * 1024
elif line.startswith("MemShared:"):
elif line.startswith(b'MemShared:'):
shared = int(line.split()[1]) * 1024
avail = inactive + cached + free
used = active + wired + cached
Expand Down

0 comments on commit e98db38

Please sign in to comment.