Skip to content

Commit fd5ced6

Browse files
committed
Use izip_longest for Python 2
1 parent 32a7e80 commit fd5ced6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

easybuild/tools/loose_version.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
# - Changes to documentation and formatting
1111

1212
import re
13-
from itertools import zip_longest
13+
# Modified: Make this compatible with Python 2
14+
try:
15+
from itertools import zip_longest
16+
except ImportError:
17+
# Python 2
18+
from itertools import izip_longest as zip_longest
1419

1520

1621
class LooseVersion(object):

0 commit comments

Comments
 (0)