Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Dec 20, 2024
1 parent dd17b7a commit aa5591e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion psutil/_pssunos.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,9 @@ def net_connections(self, kind='inet'):
@wrap_exceptions
def memory_maps(self):
def toaddr(start, end):
return f"{hex(start)[2:].strip('L')}-{hex(end)[2:].strip('L')}"
return "{}-{}".format(
hex(start)[2:].strip('L'), hex(end)[2:].strip('L')
)

procfs_path = self._procfs_path
retlist = []
Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ def test_cpu_affinity_errs(self):
p.cpu_affinity(invalid_cpu)
with pytest.raises(ValueError):
p.cpu_affinity(range(10000, 11000))
with pytest.raises(TypeError):
with pytest.raises((TypeError, ValueError)):
p.cpu_affinity([0, "1"])
with pytest.raises(ValueError):
p.cpu_affinity([0, -1])
Expand Down

0 comments on commit aa5591e

Please sign in to comment.