Graphics/PackageDiagramBuilder.py

branch
Py2 comp.
changeset 2602
affc66a603c7
parent 2525
8b507a9a2d40
child 3057
10516539f238
--- a/Graphics/PackageDiagramBuilder.py	Sat Apr 20 19:52:20 2013 +0200
+++ b/Graphics/PackageDiagramBuilder.py	Sat Apr 20 20:29:37 2013 +0200
@@ -11,7 +11,10 @@
 
 import glob
 import os.path
-import itertools
+try:  # Py3
+    from itertools import zip_longest
+except ImportError:
+    from itertools import izip_longest as zip_longest
 
 from PyQt4.QtGui import QProgressDialog, QApplication, QGraphicsTextItem
 
@@ -328,7 +331,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