Skip to content

Commit

Permalink
fix #1017 / net_io_counters(): do not raise RuntimeError in case no N…
Browse files Browse the repository at this point in the history
…ICs are installed
  • Loading branch information
giampaolo committed Apr 23, 2017
1 parent b499cc2 commit 91068b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

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

*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 @@ -2083,8 +2083,6 @@ def net_io_counters(pernic=False):
described above as the values.
"""
rawdict = _psplatform.net_io_counters()
if not rawdict:
raise RuntimeError("couldn't find any network interface")
if pernic:
for nic, fields in rawdict.items():
rawdict[nic] = _common.snetio(*fields)
Expand Down

0 comments on commit 91068b5

Please sign in to comment.