From f0185fb04ba0bf3202fbbebf649e50e968ab6ce3 Mon Sep 17 00:00:00 2001 From: Nicolas Hennion Date: Tue, 20 Aug 2013 14:53:44 +0200 Subject: [PATCH] Add control on psutil.net_io_counters / Bug on some Debian distrib --- glances/glances.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/glances/glances.py b/glances/glances.py index 81c0c976..fa4e4430 100644 --- a/glances/glances.py +++ b/glances/glances.py @@ -1391,10 +1391,16 @@ class GlancesStats: if psutil_net_io_counters: # psutil >= 1.0.0 - get_net_io_counters = psutil.net_io_counters(pernic=True) + try: + get_net_io_counters = psutil.net_io_counters(pernic=True) + except IOError: + self.network_error_tag = True else: # psutil < 1.0.0 - get_net_io_counters = psutil.network_io_counters(pernic=True) + try: + get_net_io_counters = psutil.network_io_counters(pernic=True) + except IOError: + self.network_error_tag = True if not hasattr(self, 'network_old'): try: