From 1373a1dc1d6850281d3c6d03abce094ec63bb3ad Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 3 Aug 2021 12:45:53 +0200 Subject: [PATCH] Use izip_longest for Python 2 --- easybuild/tools/loose_version.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/easybuild/tools/loose_version.py b/easybuild/tools/loose_version.py index aaf6235bd5..adcb10998c 100644 --- a/easybuild/tools/loose_version.py +++ b/easybuild/tools/loose_version.py @@ -10,7 +10,12 @@ # - Changes to documentation and formatting import re -from itertools import zip_longest +# Modified: Make this compatible with Python 2 +try: + from itertools import zip_longest +except ImportError: + # Python 2 + from itertools import izip_longest as zip_longest class LooseVersion(object):