Graphics/UMLClassDiagramBuilder.py

branch
Py2 comp.
changeset 2602
affc66a603c7
parent 2525
8b507a9a2d40
child 3057
10516539f238
diff -r f415080106ba -r affc66a603c7 Graphics/UMLClassDiagramBuilder.py
--- a/Graphics/UMLClassDiagramBuilder.py	Sat Apr 20 19:52:20 2013 +0200
+++ b/Graphics/UMLClassDiagramBuilder.py	Sat Apr 20 20:29:37 2013 +0200
@@ -8,8 +8,10 @@
 """
 
 from __future__ import unicode_literals    # __IGNORE_WARNING__
-
-import itertools
+try:  # Py3
+    from itertools import zip_longest
+except ImportError:
+    from itertools import izip_longest as zip_longest
 
 from PyQt4.QtGui import QGraphicsTextItem
 
@@ -206,7 +208,7 @@
         # generations across height
         y = 10.0
         for currentWidth, currentHeight, generation in \
-                itertools.zip_longest(widths, heights, generations):
+                zip_longest(widths, heights, generations):
             x = 10.0
             # whiteSpace is the space between any two elements
             whiteSpace = (width - currentWidth - 20) / (len(generation) - 1.0 or 2.0)

eric ide

mercurial