Merge remote-tracking branch 'kovidgoyal/fix-latest-psutil-network' into develop

This commit is contained in:
Kim Silkebækken 2013-07-31 08:11:55 +02:00
commit 69db1a905f
1 changed files with 4 additions and 1 deletions

View File

@ -497,7 +497,10 @@ try:
import psutil
def _get_bytes(interface):
io_counters = psutil.network_io_counters(pernic=True)
try:
io_counters = psutil.net_io_counters(pernic=True)
except AttributeError:
io_counters = psutil.network_io_counters(pernic=True)
if_io = io_counters.get(interface)
if not if_io:
return None