Revision: 3874
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3874&view=rev
Author:   jouni
Date:     2007-09-21 23:48:49 -0700 (Fri, 21 Sep 2007)

Log Message:
-----------
Replace some generator expressions by list comprehensions for
Python 2.3 compatibility

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
    trunk/matplotlib/lib/matplotlib/dviread.py

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py     2007-09-21 
16:54:32 UTC (rev 3873)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py     2007-09-22 
06:48:49 UTC (rev 3874)
@@ -541,10 +541,10 @@
                     widths[ch] = afmdata.get_width_char(ch, isord=True)
                 except KeyError:
                     pass
-            not_None = (ch for ch in range(256) 
-                        if widths[ch] is not None)
-            firstchar = not_None.next()
-            lastchar = max(not_None)
+            not_None = [ch for ch in range(256) 
+                        if widths[ch] is not None]
+            firstchar = not_None[0]
+            lastchar = not_None[-1]
             widths = widths[firstchar:lastchar+1]
             for i,w in enumerate(widths):
                 if w is None: widths[i] = 0

Modified: trunk/matplotlib/lib/matplotlib/dviread.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/dviread.py  2007-09-21 16:54:32 UTC (rev 
3873)
+++ trunk/matplotlib/lib/matplotlib/dviread.py  2007-09-22 06:48:49 UTC (rev 
3874)
@@ -350,9 +350,9 @@
     def _xxx(self, special):
         matplotlib.verbose.report(
             'Dvi._xxx: encountered special: %s'
-            % ''.join((32 <= ord(ch) < 127) and ch 
-                      or '<%02x>' % ord(ch)
-                      for ch in special),
+            % ''.join([(32 <= ord(ch) < 127) and ch 
+                       or '<%02x>' % ord(ch)
+                       for ch in special]),
             'debug')
 
     def _fnt_def(self, k, c, s, d, a, l, n):


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to