From af458f7f2107acce07a8c43635385b7213e1c9e3 Mon Sep 17 00:00:00 2001 From: Samuel Gaist <samuel.gaist@idiap.ch> Date: Thu, 27 Sep 2018 11:21:33 +0200 Subject: [PATCH] [statistics][view] Fix use of izip_longest --- beat/web/statistics/views.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/beat/web/statistics/views.py b/beat/web/statistics/views.py index f35426c98..572a34c3d 100644 --- a/beat/web/statistics/views.py +++ b/beat/web/statistics/views.py @@ -27,7 +27,11 @@ import datetime -import itertools + +try: + from itertools import izip_longest +except ImportError: + from itertools import zip_longest as izip_longest import simplejson @@ -152,7 +156,7 @@ def convert_values(stats): def grouper(n, iterable, fillvalue=None): "grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx" args = [iter(iterable)] * n - return itertools.izip_longest(fillvalue=fillvalue, *args) + return izip_longest(fillvalue=fillvalue, *args) def get_statistics(hours_to_go_back, cluster_by): -- GitLab