Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c7ef59

Browse files
committed
Replace some generator expressions by list comprehensions for
Python 2.3 compatibility svn path=/trunk/matplotlib/; revision=3874
1 parent 46131a9 commit 9c7ef59

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

lib/matplotlib/backends/backend_pdf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,10 @@ def embedType1(self, filename, fontinfo):
541541
widths[ch] = afmdata.get_width_char(ch, isord=True)
542542
except KeyError:
543543
pass
544-
not_None = (ch for ch in range(256)
545-
if widths[ch] is not None)
546-
firstchar = not_None.next()
547-
lastchar = max(not_None)
544+
not_None = [ch for ch in range(256)
545+
if widths[ch] is not None]
546+
firstchar = not_None[0]
547+
lastchar = not_None[-1]
548548
widths = widths[firstchar:lastchar+1]
549549
for i,w in enumerate(widths):
550550
if w is None: widths[i] = 0

lib/matplotlib/dviread.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,9 @@ def _fnt_num(self, k):
350350
def _xxx(self, special):
351351
matplotlib.verbose.report(
352352
'Dvi._xxx: encountered special: %s'
353-
% ''.join((32 <= ord(ch) < 127) and ch
354-
or '<%02x>' % ord(ch)
355-
for ch in special),
353+
% ''.join([(32 <= ord(ch) < 127) and ch
354+
or '<%02x>' % ord(ch)
355+
for ch in special]),
356356
'debug')
357357

358358
def _fnt_def(self, k, c, s, d, a, l, n):

0 commit comments

Comments
 (0)