Mock Version: 1.2.17 Mock Version: 1.2.17 ENTER ['do'](['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target noarch --nodeps /builddir/build/SPECS/python-pypng.spec'], chrootPath='/var/lib/mock/centos7-rutgers-staging-build-5370-8420/root'shell=FalseprintOutput=Falseenv={'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'PROMPT_COMMAND': 'printf "\x1b]0;\x07"', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOME': '/builddir', 'HOSTNAME': 'mock'}gid=135user='mockbuild'timeout=86400logger=uid=488) Executing command: ['bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target noarch --nodeps /builddir/build/SPECS/python-pypng.spec'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'PROMPT_COMMAND': 'printf "\x1b]0;\x07"', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOME': '/builddir', 'HOSTNAME': 'mock'} and shell False sh: /usr/bin/python3: No such file or directory sh: /usr/bin/python2: No such file or directory sh: /usr/bin/python2: No such file or directory sh: /usr/bin/python3: No such file or directory sh: /usr/bin/python3: No such file or directory sh: /usr/bin/python3: No such file or directory warning: Could not canonicalize hostname: opus7.rutgers.edu Building target platforms: noarch Building for target noarch Wrote: /builddir/build/SRPMS/python-pypng-0.0.18-1.ru7.src.rpm Child return code was: 0 ENTER ['do'](['bash', '--login', '-c', u'/usr/bin/rpmbuild -bb --target noarch --nodeps /builddir/build/SPECS/python-pypng.spec'], chrootPath='/var/lib/mock/centos7-rutgers-staging-build-5370-8420/root'shell=Falseuid=488env={'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'PROMPT_COMMAND': 'printf "\x1b]0;\x07"', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOME': '/builddir', 'HOSTNAME': 'mock'}gid=135user='mockbuild'timeout=86400private_network=Truelogger=printOutput=False) Executing command: ['bash', '--login', '-c', u'/usr/bin/rpmbuild -bb --target noarch --nodeps /builddir/build/SPECS/python-pypng.spec'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'PROMPT_COMMAND': 'printf "\x1b]0;\x07"', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOME': '/builddir', 'HOSTNAME': 'mock'} and shell False Building target platforms: noarch Building for target noarch Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.OX8lMS + umask 022 + cd /builddir/build/BUILD + cd /builddir/build/BUILD + rm -rf pypng-pypng-0.0.18 + /usr/bin/gzip -dc /builddir/build/SOURCES/pypng-0.0.18.tar.gz + /usr/bin/tar -xf - + STATUS=0 + '[' 0 -ne 0 ']' + cd pypng-pypng-0.0.18 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + rm -rf pypng.egg-info + lib=code/png.py + sed '1{\@^#!/usr/bin/env python@d}' code/png.py + touch -r code/png.py code/png.py.new + mv code/png.py.new code/png.py + rm -rf /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7 + cp -a . /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7 + 2to3 --write --nobackups /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7 RefactoringTool: Skipping implicit fixer: buffer RefactoringTool: Skipping implicit fixer: idioms RefactoringTool: Skipping implicit fixer: set_literal RefactoringTool: Skipping implicit fixer: ws_comma RefactoringTool: No changes to /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/setup.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/exnumpy.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/iccp.py --- /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/exnumpy.py (original) +++ /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/exnumpy.py (refactored) @@ -57,7 +57,7 @@ # to hold any pixel value for any PNG image but uses 4 bytes per value when # 1 or 2 would be enough. # --- extract 001 start -image_2d = numpy.vstack(itertools.imap(numpy.uint16, pngdata)) +image_2d = numpy.vstack(map(numpy.uint16, pngdata)) # --- extract 001 end # Do not be tempted to use ``numpy.asarray``; when passed an iterator # (`pngdata` is often an iterator) it will attempt to create a size 1 --- /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/iccp.py (original) +++ /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/iccp.py (refactored) @@ -58,9 +58,9 @@ if len(profile) < 128: raise FormatError("ICC Profile is too short.") d.update( - zip(['size', 'preferredCMM', 'version', + list(zip(['size', 'preferredCMM', 'version', 'profileclass', 'colourspace', 'pcs'], - struct.unpack('>L4sL4s4s4s', profile[:24]))) + struct.unpack('>L4sL4s4s4s', profile[:24])))) if len(profile) < d['size']: warnings.warn( 'Profile size declared to be %d, but only got %d bytes' % @@ -68,8 +68,8 @@ d['version'] = '%08x' % d['version'] d['created'] = readICCdatetime(profile[24:36]) d.update( - zip(['acsp', 'platform', 'flag', 'manufacturer', 'model'], - struct.unpack('>4s4s3L', profile[36:56]))) + list(zip(['acsp', 'platform', 'flag', 'manufacturer', 'model'], + struct.unpack('>4s4s3L', profile[36:56])))) if d['acsp'] != 'acsp': warnings.warn('acsp field not present (not an ICC Profile?).') d['deviceattributes'] = profile[56:64] @@ -89,7 +89,7 @@ # the ICC spec. # Convert (sig,offset,size) triples into (sig,value) pairs. - rawtag = map(lambda x: (x[0], profile[x[1]:x[1]+x[2]]), tt) + rawtag = [(x[0], profile[x[1]:x[1]+x[2]]) for x in tt] self.rawtagtable = rawtag self.rawtagdict = dict(rawtag) tag = dict() @@ -130,7 +130,7 @@ def _addTags(self, **k): """Helper for :meth:`addTags`.""" - for tag, thing in k.items(): + for tag, thing in list(k.items()): if not isinstance(thing, (tuple, list)): thing = (thing,) typetag = defaulttagtype[tag] @@ -141,7 +141,7 @@ """Write ICC Profile to the file.""" if not self.rawtagtable: - self.rawtagtable = self.rawtagdict.items() + self.rawtagtable = list(self.rawtagdict.items()) tags = tagblock(self.rawtagtable) self.writeHeader(out, 128 + len(tags)) out.write(tags) @@ -181,14 +181,14 @@ pcsilluminant=encodefuns()['XYZ'](*D50()), creator=z, ) - for k,v in defaults.items(): + for k,v in list(defaults.items()): defaultkey(self.d, k, v) - hl = map(self.d.__getitem__, + hl = list(map(self.d.__getitem__, ['preferredCMM', 'version', 'profileclass', 'colourspace', 'pcs', 'created', 'acsp', 'platform', 'flag', 'manufacturer', 'model', 'deviceattributes', 'intent', - 'pcsilluminant', 'creator']) + 'pcsilluminant', 'creator'])) # Convert to struct.pack input hl[1] = int(hl[1], 16) @@ -245,7 +245,7 @@ return struct.pack('>L%dH' % n, n, *table) def XYZ(*l): - return struct.pack('>3l', *map(fs15f16, l)) + return struct.pack('>3l', *list(map(fs15f16, l))) return locals() @@ -346,9 +346,9 @@ def iccp(out, inp): profile = Profile().fromString(*profileFromPNG(inp)) - print >>out, profile.d - print >>out, map(lambda x: x[0], profile.rawtagtable) - print >>out, profile.tag + print(profile.d, fileRefactoringTool: No changes to /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/mkiccp.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/plan9topng.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/png.py =out) + print([x[0] for x in profile.rawtagtable], file=out) + print(profile.tag, file=out) def profileFromPNG(inp): """Extract profile from PNG file. Return (*profile*, *name*) @@ -409,7 +409,7 @@ # values are preserved. n = len(s)//4 t = struct.unpack('>%dl' % n, s) - return map((2**-16).__mul__, t) + return list(map((2**-16).__mul__, t)) # Several types and their byte encodings are defined by [ICC 2004] # section 10. When encoded, a value begins with a 4 byte type @@ -513,7 +513,7 @@ def group(s, n): # See # http://www.python.org/doc/2.6/library/functions.html#zip - return zip(*[iter(s)]*n) + return list(zip(*[iter(s)]*n)) def main(argv=None): --- /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/plan9topng.py (original) +++ /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/plan9topng.py (refactored) @@ -23,7 +23,7 @@ def block(s, n): # See http://www.python.org/doc/2.6.2/library/functions.html#zip - return zip(*[iter(s)]*n) + return list(zip(*[iter(s)]*n)) def convert(f, output=sys.stdout) : """Convert Plan 9 file to PNG format. Works with either uncompressed @@ -58,7 +58,7 @@ r = r.split() # :todo: raise FormatError assert len(r) == 5 - r = [r[0]] + map(int, r[1:]) + r = [r[0]] + list(map(int, r[1:])) return r def bitdepthof(pixel) : @@ -99,7 +99,7 @@ meta=dict(size=(width,rows), bitdepth=bitdepthof(chan), greyscale=greyscale, alpha=alpha, planes=nchans) - return itertools.imap(lambda x: itertools.chain(*x), + return map(lambda x: itertools.chain(*x), block(unpack(f, rows, width, chan, maxval), width)), meta def png(out, metadata, f): @@ -183,7 +183,7 @@ x <<= depth # number of bits in each channel - chan = map(int, re.findall(r'\d+', pixel)) + chan = list(map(int, re.findall(r'\d+', pixel))) # type of each channel type = re.findall('[a-z]', pixel) --- /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/png.py (original) +++ /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/png.py (refactored) @@ -142,11 +142,12 @@ """ # http://www.python.org/doc/2.2.3/whatsnew/node5.html -from __future__ import generators + __version__ = "0.0.18" from array import array +from functools import reduce try: # See :pyver:old import itertools except ImportError: @@ -187,7 +188,7 @@ def group(s, n): # See http://www.python.org/doc/2.6/library/functions.html#zip - return zip(*[iter(s)]*n) + return list(zip(*[iter(s)]*n)) def isarray(x): """Same as ``isinstance(x, array)`` except on Python 2.2, where it @@ -764,15 +765,15 @@ a.extend([0]*int(extra)) # Pack into bytes l = group(a, spb) - l = map(lambda e: reduce(lambda x,y: - (x << self.bitdepth) + y, e), l) + l = [reduce(lambda x,y: + (x << self.bitdepth) + y, e) for e in l] data.extend(l) if self.rescale: oldextend = extend factor = \ float(2**self.rescale[1]-1) / float(2**self.rescale[0]-1) def extend(sl): - oldextend(map(lambda x: int(round(factor*x)), sl)) + oldextend([int(round(factor*x)) for x in sl]) # Build the first row, testing mostly to see if we need to # changed the extend function to cope with NumPy integer types @@ -787,7 +788,7 @@ # :todo: Certain exceptions in the call to ``.next()`` or the # following try would indicate no row data supplied. # Should catch. - i,row = enumrows.next() + i,row = next(enumrows) try: # If this fails... extend(row) @@ -797,7 +798,7 @@ # types, there are probably lots of other, unknown, "nearly" # int types it works for. def wrapmapint(f): - return lambda sl: f(map(int, sl)) + return lambda sl: f(list(map(int, sl))) extend = wrapmapint(extend) del wrapmapint extend(row) @@ -1246,7 +1247,7 @@ # first row, which requires that we take a copy of its iterator. # We may also need the first row to derive width and bitdepth. a,t = itertools.tee(a) - row = t.next() + row = next(t) del t try: row[0][0] @@ -1650,12 +1651,12 @@ spb = 8//self.bitdepth out = array('B') mask = 2**self.bitdepth - 1 - shifts = map(self.bitdepth.__mul__, reversed(range(spb))) + shifts = list(map(self.bitdepth.__mul__, reversed(list(range(spb))))) for o in raw: - out.extend(map(lambda i: mask&(o>>i), shifts)) + out.extend([mask&(o>>i) for i in shifts]) return out[:width] - return itertools.imap(asvalues, rows) + return map(asvalues, rows) def serialtoflat(self, bytes, width=None): """Convert serial format (byte stream) pixel data to flat row @@ -1675,7 +1676,7 @@ spb = 8//self.bitdepth out = array('B') mask = 2**self.bitdepth - 1 - shifts = map(self.bitdepth.__mul__, reversed(range(spb))) + shifts = list(map(self.bitdepth.__mul__, reversed(list(range(spb))))) l = width for o in bytes: out.extend([(mask&(o>>s)) for s in shifts][:l]) @@ -1915,7 +1916,7 @@ while True: try: type, data = self.chunk(lenient=lenient) - except ValueError, e: + except ValueError as e: raise ChunkError(e.args[0]) if type == 'IEND': # http://www.w3.org/TR/PNG/#11IEND @@ -1953,7 +1954,7 @@ arraycode = 'BH'[self.bitdepth>8] # Like :meth:`group` but producing an array.array object for # each row. - pixels = itertools.imap(lambda *row: array(arraycode, row), + pixels = map(lambda *row: array(arraycode, row), *[iter(self.deinterlace(raw))]*self.width*self.planes) else: pixels = self.iterboxed(self.iterstraight(raw)) @@ -2008,7 +2009,7 @@ if self.trns or alpha == 'force': trns = array('B', self.trns or '') trns.extend([255]*(len(plte)-len(trns))) - plte = map(operator.add, plte, group(trns, 1)) + plte = list(map(operator.add, plte, group(trns, 1))) return plte def asDirect(self): @@ -2065,7 +2066,7 @@ plte = self.palette() def iterpal(pixels): for row in pixels: - row = map(plte.__getitem__, row) + row = list(map(plte.__getitem__, row)) yield array('B', itertools.chain(*row)) pixels = iterpal(pixels) elif self.trns: @@ -2090,11 +2091,11 @@ # True/False to 0/maxval (by multiplication), # and add it as the extra channel. row = group(row, planes) - opa = map(it.__ne__, row) - opa = map(maxval.__mul__, opa) - opa = zip(opa) # convert to 1-tuples + opa = list(map(it.__ne__, row)) + opa = list(map(maxval.__mul__, opa)) + opa = list(zip(opa)) # convert to 1-tuples yield array(typecode, - itertools.chain(*map(operator.add, row, opa))) + itertools.chain(*list(map(operator.add, row, opa)))) pixels = itertrns(pixels) targetbitdepth = None if self.sbit: @@ -2112,7 +2113,7 @@ meta['bitdepth'] = targetbitdepth def itershift(pixels): for row in pixels: - yield map(shift.__rrshift__, row) + yield list(map(shift.__rrshift__, row)) pixels = itershift(pixels) return x,y,pixels,meta @@ RefactoringTool: Refactored /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/test_png.py -2129,7 +2130,7 @@ factor = float(maxval)/float(sourcemaxval) def iterfloat(): for row in pixels: - yield map(factor.__mul__, row) + yield list(map(factor.__mul__, row)) return x,y,iterfloat(),info def _as_rescale(self, get, targetbitdepth): @@ -2142,7 +2143,7 @@ meta['bitdepth'] = targetbitdepth def iterscale(): for row in pixels: - yield map(lambda x: int(round(x*factor)), row) + yield [int(round(x*factor)) for x in row] if maxval == targetmaxval: return width, height, pixels, meta else: @@ -2343,7 +2344,7 @@ # Expect to get here on Python 2.2 def array(typecode, init=()): if type(init) == str: - return map(ord, init) + return list(map(ord, init)) return list(init) # Further hacks to get it limping along on Python 2.2 @@ -2742,7 +2743,7 @@ # care about TUPLTYPE. greyscale = depth <= 2 pamalpha = depth in (2,4) - supported = map(lambda x: 2**x-1, range(1,17)) + supported = [2**x-1 for x in range(1,17)] try: mi = supported.index(maxval) except ValueError: @@ -2779,5 +2780,5 @@ if __name__ == '__main__': try: _main(sys.argv) - except Error, e: - print >>sys.stderr, e + except Error as e: + print(e, file=sys.stderr) --- /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/test_png.py (original) +++ /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/test_png.py (refactored) @@ -19,7 +19,7 @@ try: from io import BytesIO except ImportError: - from StringIO import StringIO as BytesIO + from io import StringIO as BytesIO import itertools import struct import sys @@ -49,7 +49,7 @@ import os - print name + print(name) f = BytesIO() w = png.Writer(x, y, **k) w.write(f, rows) @@ -122,13 +122,13 @@ # tested. Making it a test for Issue 20 (googlecode). w = png.Writer(15, 17, greyscale=True, bitdepth=n, chunk_limit=99) f = BytesIO() - w.write_array(f, array('B', map(mask.__and__, range(1, 256)))) + w.write_array(f, array('B', list(map(mask.__and__, list(range(1, 256)))))) r = png.Reader(bytes=f.getvalue()) x,y,pixels,meta = r.read() self.assertEqual(x, 15) self.assertEqual(y, 17) self.assertEqual(list(itertools.chain(*pixels)), - map(mask.__and__, range(1,256))) + list(map(mask.__and__, list(range(1,256))))) def testL8(self): return self.helperLN(8) def testL4(self): @@ -137,7 +137,7 @@ "Also tests asRGB8." w = png.Writer(1, 4, greyscale=True, bitdepth=2) f = BytesIO() - w.write_array(f, array('B', range(4))) + w.write_array(f, array('B', list(range(4)))) r = png.Reader(bytes=f.getvalue()) x,y,pixels,meta = r.asRGB8() self.assertEqual(x, 1) @@ -157,7 +157,7 @@ x,y,pixels,meta = r.asRGB8() self.assertEqual(x, 1) self.assertEqual(y, 4) - self.assertEqual(map(list, pixels), map(list, [a, b, b, c])) + self.assertEqual(list(map(list, pixels)), list(map(list, [a, b, b, c]))) def testPtrns(self): "Test colour type 3 and tRNS chunk (and 4-bit palette)." a = (50,99,50,50) @@ -176,8 +176,8 @@ d = d+(255,) e = e+(255,) boxed = [(e,d,c),(d,c,a),(c,a,b)] - flat = map(lambda row: itertools.chain(*row), boxed) - self.assertEqual(map(list, pixels), map(list, flat)) + flat = [itertools.chain(*row) for row in boxed] + self.assertEqual(list(map(list, pixels)), list(map(list, flat))) def testRGBtoRGBA(self): """asRGBA8() on colour type 2 source.""" # Test for Issue 26 (googlecode) @@ -216,7 +216,7 @@ candi = candidate.replace('n', 'i') if candi not in pngsuite.png: continue - print 'adam7 read', candidate + print('adam7 read', candidate) straight = png.Reader(bytes=pngsuite.png[candidate]) adam7 = png.Reader(bytes=pngsuite.png[candi]) # Just compare the pixels. Ignore x,y (because they're @@ -224,7 +224,7 @@ # "interlace" member differs. Lame. straight = straight.read()[2] adam7 = adam7.read()[2] - self.assertEqual(map(list, straight), map(list, adam7)) + self.assertEqual(list(map(list, straight)), list(map(list, adam7))) def testAdam7write(self): """Adam7 interlace writing. For each test image in the PngSuite, write an interlaced @@ -233,7 +233,7 @@ # Not such a great test, because the only way we can check what # we have written is to read it back again. - for name,bytes in pngsuite.png.iteritems(): + for name,bytes in pngsuite.png.items(): # Only certain colour types supported for this test. if name[3:5] not in ['n0', 'n2', 'n4', 'n6']: continue @@ -253,7 +253,7 @@ transparent=it.transparent, interlace=True) x,y,pi,meta = png.Reader(bytes=pngs).read() - self.assertEqual(map(list, ps), map(list, pi)) + self.assertEqual(list(map(list, ps)), list(map(list, pi))) def testPGMin(self): """Test that the command line tool can read PGM files.""" def do(): @@ -356,7 +356,7 @@ return self.helperLtrns((0,)) def helperLtrns(self, transparent): """Helper used by :meth:`testLtrns*`.""" - pixels = zip([0x00, 0x38, 0x4c, 0x54, 0x5c, 0x40, 0x38, 0x00]) + pixels = list(zip([0x00, 0x38, 0x4c, 0x54, 0x5c, 0x40, 0x38, 0x00])) o = BytesIO() w = png.Writer(8, 8, greyscale=True, bitdepth=1, transparent=transparent) w.write_packed(o, pixels) @@ -501,7 +501,7 @@ [[255, 0, 0], [0, 0, 0]]], 'RGB') img.save(BytesIO()) def testfromarrayL16(self): - img = png.from_array(group(range(2**16), 256), 'L;16') + img = png.from_array(group(list(range(2**16)), 256), 'L;16') img.save(BytesIO()) def testfromarrayRGB(self): img = png.from_array([[0,0,0, 0,0,1, 0,1,0, 0,1,1], @@ -510,7 +510,7 @@ img.save(o) def testfromarrayIter(self): i = itertools.islice(itertools.count(10), 20) - i = itertools.imap(lambda x: [x, x, x], i) + i = map(lambda x: [x, x, x], i) img = png.from_array(i, 'RGB;5', dict(height=20)) f = BytesIO() img.save(f) @@ -531,10 +531,10 @@ try: import numpy except ImportError: - print >>sys.stderr, "skipping numpy test" + print("skipping numpy test", file=sys.stderr) return - rows = [map(numpy.uint16, range(0,0x10000,0x5555))] + rows = [list(map(numpy.uint16, list(range(0,0x10000,0x5555))))] b = topngbytes('numpyuint16.png', rows, 4, 1, greyscale=True, alpha=False, bitdepth=16) def testNumpyuint8(self): @@ -543,10 +543,10 @@ try: import numpy except ImportError: - print >>sys.stderr, "skipping numpy test" + print("skipping numpy test", file=sys.stderr) return - rows = [map(numpy.uint8, range(0,0x100,0x55))] + rows = [list(map(numpy.uint8, list(range(0,0x100,0x55))))] b = topngbytes('numpyuint8.png', rows, 4, 1, greyscale=True, alpha=False, bitdepth=8) def testNumpybool(self): @@ -555,10 +555,10 @@ try: import numpy except ImportError: - print >>sys.stderr, "skipping numpy test" + print("skipping numpy test", file=sys.stderr) return - rows = [map(numpy.bool, [0,1])] + rows = [list(map(numpy.bool, [0,1]))] b = topngbytes('numpybool.png', rows, 2, 1, greyscale=True, alpha=False, bRefactoringTool: Refactored /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/texttopng.py RefactoringTool: Refactored /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/man/conf.py RefactoringTool: Files that were modified: RefactoringTool: /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/setup.py RefactoringTool: /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/exnumpy.py RefactoringTool: /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/iccp.py RefactoringTool: /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/mkiccp.py RefactoringTool: /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/plan9topng.py RefactoringTool: /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/png.py RefactoringTool: /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/test_png.py RefactoringTool: /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/texttopng.py RefactoringTool: /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/man/conf.py itdepth=1) def testNumpyarray(self): @@ -566,7 +566,7 @@ try: import numpy except ImportError: - print >>sys.stderr, "skipping numpy test" + print("skipping numpy test", file=sys.stderr) return pixels = numpy.array([[0,0x5555],[0x5555,0xaaaa]], numpy.uint16) @@ -578,7 +578,7 @@ try: import numpy except ImportError: - print >>sys.stderr, "skipping numpy test" + print("skipping numpy test", file=sys.stderr) return s = ['110010010011', @@ -586,7 +586,7 @@ '110010110101', '100010010011'] - s = map(lambda x: map(int, x), s) + s = [list(map(int, x)) for x in s] palette = [(0x55,0x55,0x55), (0xff,0x99,0x99)] pnp = numpy.array(palette) # creates a 2x3 array @@ -677,7 +677,7 @@ r2 = png.Reader(bytes=pngsuite.png[k]) _,_,pixels1,info1 = r1.asDirect() _,_,pixels2,info2 = r2.asDirect() - for row1, row2 in itertools.izip(pixels1, pixels2): + for row1, row2 in zip(pixels1, pixels2): self.assertEqual(row1, row2) for i in range(len(row1)): row1[i] = 11117 % (i + 1) @@ -693,7 +693,7 @@ def group(s, n): # See http://www.python.org/doc/2.6/library/functions.html#zip - return zip(*[iter(s)]*n) + return list(zip(*[iter(s)]*n)) if __name__ == '__main__': unittest.main(__name__) --- /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/texttopng.py (original) +++ /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/code/texttopng.py (refactored) @@ -123,7 +123,7 @@ i = ord(i) if i not in font: return [(0,)]*8 - return map(lambda row: (ord(row),), font[i].decode('hex')) + return [(ord(row),) for row in font[i].decode('hex')] def texttoraster(m): """Convert the string *m* to a raster image. Any newlines @@ -153,8 +153,8 @@ # Assumes monospaced font. x = 8*len(m) y = 8 - return x,y,itertools.imap(lambda row: itertools.chain(*row), - zip(*map(char, m))) + return x,y,map(lambda row: itertools.chain(*row), + list(zip(*list(map(char, m))))) def render(message, out): import png --- /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/man/conf.py (original) +++ /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7/man/conf.py (refactored) @@ -23,8 +23,8 @@ templates_path = [] source_suffix = '.rst' master_doc = 'index' -project = u'PyPNG' -copyright = u'2009, ' + conf['author'] +project = 'PyPNG' +copyright = '2009, ' + conf['author'] release = conf['version'] version = release[:release.rfind('.')] language='en' @@ -52,8 +52,8 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, document class [howto/manual]). latex_documents = [ - ('index', 'PyPNG.tex', ur'PyPNG Documentation', - ur'David Jones', 'manual'), + ('index', 'PyPNG.tex', r'PyPNG Documentation', + r'David Jones', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.MIN2s1 + umask 022 + cd /builddir/build/BUILD + cd pypng-pypng-0.0.18 + /usr/bin/python2 setup.py build running build running build_py creating build creating build/lib copying code/png.py -> build/lib + pushd /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7 ~/build/BUILD/python3-python-pypng-0.0.18-1.ru7 ~/build/BUILD/pypng-pypng-0.0.18 + /usr/bin/python3 setup.py build running build running build_py creating build creating build/lib copying code/png.py -> build/lib Fixing build/lib/png.py Skipping implicit fixer: buffer Skipping implicit fixer: idioms Skipping implicit fixer: set_literal Skipping implicit fixer: ws_comma Can't parse build/lib/png.py: ParseError: bad input: type=22, value='=', context=('', (2784, 21)) Fixing build/lib/png.py Skipping implicit fixer: buffer Skipping implicit fixer: idioms Skipping implicit fixer: set_literal Skipping implicit fixer: ws_comma ~/build/BUILD/pypng-pypng-0.0.18 + popd + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.QRtNYh + umask 022 + cd /builddir/build/BUILD + '[' /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch '!=' / ']' + rm -rf /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch ++ dirname /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch + mkdir -p /builddir/build/BUILDROOT + mkdir /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch + cd pypng-pypng-0.0.18 + pushd /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7 ~/build/BUILD/python3-python-pypng-0.0.18-1.ru7 ~/build/BUILD/pypng-pypng-0.0.18 + /usr/bin/python3 setup.py install -O1 --skip-build --root=/builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch running install running install_lib creating /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr creating /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/lib creating /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/lib/python3.4 creating /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/lib/python3.4/site-packages copying build/lib/png.py -> /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/lib/python3.4/site-packages byte-compiling /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/lib/python3.4/site-packages/png.py to png.cpython-34.pyc writing byte-compilation script '/tmp/tmp5lcm3skb.py' /usr/bin/python3 -O /tmp/tmp5lcm3skb.py removing /tmp/tmp5lcm3skb.py running install_egg_info running egg_info creating code/pypng.egg-info writing code/pypng.egg-info/PKG-INFO writing dependency_links to code/pypng.egg-info/dependency_links.txt writing top-level names to code/pypng.egg-info/top_level.txt writing manifest file 'code/pypng.egg-info/SOURCES.txt' reading manifest file 'code/pypng.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no directories found matching 'html' warning: no previously-included files matching '*.pyc' found anywhere in distribution warning: no previously-included files matching '*.DS_Store' found anywhere in distribution writing manifest file 'code/pypng.egg-info/SOURCES.txt' Copying code/pypng.egg-info to /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/lib/python3.4/site-packages/pypng-0.0.18-py3.4.egg-info running install_scripts + popd ~/build/BUILD/pypng-pypng-0.0.18 + /usr/bin/python2 setup.py install -O1 --skip-build --root=/builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch running install running install_lib creating /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/lib/python2.7 creating /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/lib/python2.7/site-packages copying build/lib/png.py -> /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/lib/python2.7/site-packages byte-compiling /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/lib/python2.7/site-packages/png.py to png.pyc writing byte-compilation script '/tmp/tmpm_fc2E.py' /usr/bin/python2 -O /tmp/tmpm_fc2E.py removing /tmp/tmpm_fc2E.py running install_egg_info running egg_info creating code/pypng.egg-info writing code/pypng.egg-info/PKG-INFO writing top-level names to code/pypng.egg-info/top_level.txt writing dependency_links to code/pypng.egg-info/dependency_links.txt writing manifest file 'code/pypng.egg-info/SOURCES.txt' reading manifest file 'code/pypng.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no directories found matching 'html' warning: no previously-included files matching '*.pyc' found anywhere in distribution warning: no previously-included files matching '*.DS_Store' found anywhere in distribution writing manifest file 'code/pypng.egg-info/SOURCES.txt' Copying code/pypng.egg-info to /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/lib/python2.7/site-packages/pypng-0.0.18-py2.7.egg-info running install_scripts + /usr/lib/rpm/find-debuginfo.sh --strict-build-id -m --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 50000000 /builddir/build/BUILD/pypng-pypng-0.0.18 /usr/lib/rpm/sepdebugcrcfix: Updated 0 CRC32s, 0 CRC32s did match. find: 'debug': No such file or directory + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-compress + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1 Bytecompiling .py files below /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/lib/python3.4 using /usr/bin/python3.4 Bytecompiling .py files below /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/lib/python2.7 using /usr/bin/python2.7 + /usr/lib/rpm/redhat/brp-python-hardlink + /usr/lib/rpm/redhat/brp-java-repack-jars Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.OyJizW + umask 022 + cd /builddir/build/BUILD + cd pypng-pypng-0.0.18 + nosetests code/png.py ---------------------------------------------------------------------- Ran 0 tests in 0.000s OK + pushd /builddir/build/BUILD/python3-python-pypng-0.0.18-1.ru7 + nosetests-3.4 code/png.py ~/build/BUILD/python3-python-pypng-0.0.18-1.ru7 ~/build/BUILD/pypng-pypng-0.0.18 ---------------------------------------------------------------------- Ran 0 tests in 0.000s OK + popd + exit 0 ~/build/BUILD/pypng-pypng-0.0.18 Processing files: python-pypng-0.0.18-1.ru7.noarch Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.wYiveD + umask 022 + cd /builddir/build/BUILD + cd pypng-pypng-0.0.18 + DOCDIR=/builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/share/doc/python-pypng-0.0.18 + export DOCDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/share/doc/python-pypng-0.0.18 + cp -pr README.txt /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/share/doc/python-pypng-0.0.18 + cp -pr LICENCE /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/share/doc/python-pypng-0.0.18 + exit 0 Provides: python-pypng = 0.0.18-1.ru7 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: python(abi) = 2.7 Processing files: python3-pypng-0.0.18-1.ru7.noarch Executing(%doc): /bin/sh -e /var/tmp/rpm-tmp.V1PJck + umask 022 + cd /builddir/build/BUILD + cd pypng-pypng-0.0.18 + DOCDIR=/builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/share/doc/python3-pypng-0.0.18 + export DOCDIR + /usr/bin/mkdir -p /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/share/doc/python3-pypng-0.0.18 + cp -pr README.txt /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/share/doc/python3-pypng-0.0.18 + cp -pr LICENCE /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch/usr/share/doc/python3-pypng-0.0.18 + exit 0 Provides: python3-pypng = 0.0.18-1.ru7 Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 Requires: python(abi) = 3.4 Checking for unpackaged file(s): /usr/lib/rpm/check-files /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch warning: Could not canonicalize hostname: opus7.rutgers.edu Wrote: /builddir/build/RPMS/python-pypng-0.0.18-1.ru7.noarch.rpm Wrote: /builddir/build/RPMS/python3-pypng-0.0.18-1.ru7.noarch.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.oRChDq + umask 022 + cd /builddir/build/BUILD + cd pypng-pypng-0.0.18 + /usr/bin/rm -rf /builddir/build/BUILDROOT/python-pypng-0.0.18-1.ru7.noarch + exit 0 Child return code was: 0