From 40c4b7ac234cc5a23198c6ce6b60cde7e5ea44a1 Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Sun, 20 Sep 2015 19:20:49 +0200 Subject: [PATCH] exports: Python 3 compat --- glances/exports/glances_export.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/glances/exports/glances_export.py b/glances/exports/glances_export.py index 7a456918..9146cda9 100644 --- a/glances/exports/glances_export.py +++ b/glances/exports/glances_export.py @@ -136,7 +136,11 @@ class GlancesExport(object): else: pre_key = '' # Walk through the dict - for key, value in stats.iteritems(): + try: + iteritems = stats.iteritems() + except AttributeError: + iteritems = stats.items() + for key, value in iteritems: if isinstance(value, list): try: value = value[0]