From 95c34035645e788d98a3fa6b059ad48024596906 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Wed, 15 Jan 2020 10:20:22 +0100 Subject: In python2 itertools zip_longest is named izip_longest --- src/python/test/test_alpha_complex.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/python/test/test_alpha_complex.py b/src/python/test/test_alpha_complex.py index 712a50b6..0d9e9e45 100755 --- a/src/python/test/test_alpha_complex.py +++ b/src/python/test/test_alpha_complex.py @@ -11,8 +11,13 @@ from gudhi import AlphaComplex, SimplexTree import math import numpy as np -import itertools import pytest +try: + # python3 + from itertools import zip_longest +except ImportError: + # python2 + from itertools import izip_longest as zip_longest __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" @@ -114,6 +119,6 @@ def test_safe_alpha_persistence_comparison(): diag1 = simplex_tree1.persistence() diag2 = simplex_tree2.persistence() - for (first_p, second_p) in itertools.zip_longest(diag1, diag2): + for (first_p, second_p) in zip_longest(diag1, diag2): assert first_p[0] == pytest.approx(second_p[0]) assert first_p[1] == pytest.approx(second_p[1]) -- cgit v1.2.3