Skip to content

Commit

Permalink
fix #1016: do not raise RuntimeError in case no disks are installed
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Apr 23, 2017
1 parent 9f8f663 commit b499cc2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
**Bug fixes**

- 1014_: Linux can mask legitimate ENOENT exceptions as NoSuchProcess.
- 1016_: disk_io_counters() raises RuntimeError on a system with no disks.

*2017-04-10*

Expand Down
2 changes: 0 additions & 2 deletions psutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2049,8 +2049,6 @@ def disk_io_counters(perdisk=False):
executed first otherwise this function won't find any disk.
"""
rawdict = _psplatform.disk_io_counters()
if not rawdict:
raise RuntimeError("couldn't find any physical disk")
nt = getattr(_psplatform, "sdiskio", _common.sdiskio)
if perdisk:
for disk, fields in rawdict.items():
Expand Down

0 comments on commit b499cc2

Please sign in to comment.