diff --git a/beat/web/statistics/views.py b/beat/web/statistics/views.py
index f35426c98e89f4bce02b135980109020c10e80b2..572a34c3d9ac104e23d3c6d3060a1ec289bdf35d 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):