Run 2to3's print fixer over some places that had been missed. · pythoncapi/cpython@e7bf59f · GitHub
Skip to content

Commit e7bf59f

Browse files
committed
Run 2to3's print fixer over some places that had been missed.
1 parent 716c3ac commit e7bf59f

51 files changed

Lines changed: 253 additions & 253 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Mac/BuildScript/build-installer.py

Lines changed: 36 additions & 36 deletions

Mac/Demo/PICTbrowse/PICTbrowse.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ def open(self, (resid, resname)):
6969
self.resid = resid
7070
picture = Qd.GetPicture(self.resid)
7171
# Get rect for picture
72-
print repr(picture.data[:16])
72+
print(repr(picture.data[:16]))
7373
sz, t, l, b, r = struct.unpack('hhhhh', picture.data[:10])
74-
print 'pict:', t, l, b, r
74+
print('pict:', t, l, b, r)
7575
width = r-l
7676
height = b-t
7777
if width < 64: width = 64
7878
elif width > 480: width = 480
7979
if height < 64: height = 64
8080
elif height > 320: height = 320
8181
bounds = (LEFT, TOP, LEFT+width, TOP+height)
82-
print 'bounds:', bounds
82+
print('bounds:', bounds)
8383

8484
self.wid = Win.NewWindow(bounds, resname, 1, 0, -1, 1, 0)
8585
self.wid.SetWindowPic(picture)

Mac/Demo/PICTbrowse/oldPICTbrowse.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ def open(self, (resid, resname)):
6868
self.resid = resid
6969
picture = Qd.GetPicture(self.resid)
7070
# Get rect for picture
71-
print repr(picture.data[:16])
71+
print(repr(picture.data[:16]))
7272
sz, t, l, b, r = struct.unpack('hhhhh', picture.data[:10])
73-
print 'pict:', t, l, b, r
73+
print('pict:', t, l, b, r)
7474
width = r-l
7575
height = b-t
7676
if width < 64: width = 64
7777
elif width > 480: width = 480
7878
if height < 64: height = 64
7979
elif height > 320: height = 320
8080
bounds = (LEFT, TOP, LEFT+width, TOP+height)
81-
print 'bounds:', bounds
81+
print('bounds:', bounds)
8282

8383
self.wid = Win.NewWindow(bounds, resname, 1, 0, -1, 1, 0)
8484
self.wid.SetWindowPic(picture)
@@ -115,7 +115,7 @@ def do_listhit(self, event):
115115
(what, message, when, where, modifiers) = event
116116
Qd.SetPort(self.wid)
117117
where = Qd.GlobalToLocal(where)
118-
print 'LISTHIT', where
118+
print('LISTHIT', where)
119119
if self.list.LClick(where, modifiers):
120120
self.do_show()
121121

Mac/Demo/applescript/makedisk.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
try:
99
objref = talker.create('my disk image', saving_as=filespec, leave_image_mounted=1)
1010
except Disk_Copy.Error as arg:
11-
print "ERROR: my disk image:", arg
11+
print("ERROR: my disk image:", arg)
1212
else:
13-
print 'objref=', objref
14-
print 'Type return to exit-'
13+
print('objref=', objref)
14+
print('Type return to exit-')
1515
sys.stdin.readline()

Mac/Demo/imgbrowse/imgbrowse.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626

2727
def main():
28-
print 'hello world'
28+
print('hello world')
2929
imgbrowse()
3030

3131
class imgbrowse(FrameWork.Application):
@@ -84,10 +84,10 @@ def open(self, width, height, pixmap, data):
8484
def do_update(self, *args):
8585
pass
8686
currect = self.fitrect()
87-
print 'PICT:', self.pictrect
88-
print 'WIND:', currect
89-
print 'ARGS:', (self.pixmap, self.wid.GetWindowPort().GetPortBitMapForCopyBits(), self.pictrect,
90-
currect, QuickDraw.srcCopy, None)
87+
print('PICT:', self.pictrect)
88+
print('WIND:', currect)
89+
print('ARGS:', (self.pixmap, self.wid.GetWindowPort().GetPortBitMapForCopyBits(), self.pictrect,
90+
currect, QuickDraw.srcCopy, None))
9191
self.info()
9292
Qd.CopyBits(self.pixmap, self.wid.GetWindowPort().GetPortBitMapForCopyBits(), self.pictrect,
9393
currect, QuickDraw.srcCopy, None)

Mac/Demo/imgbrowse/mac_image.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ def dumppixmap(data):
3838
cmpCount, cmpSize, \
3939
planeBytes, pmTable, pmReserved \
4040
= struct.unpack("lhhhhhhhlllhhhhlll", data)
41-
print 'Base: 0x%x'%baseAddr
42-
print 'rowBytes: %d (0x%x)'%(rowBytes&0x3fff, rowBytes)
43-
print 'rect: %d, %d, %d, %d'%(t, l, b, r)
44-
print 'pmVersion: 0x%x'%pmVersion
45-
print 'packing: %d %d'%(packType, packSize)
46-
print 'resolution: %f x %f'%(float(hRes)/0x10000, float(vRes)/0x10000)
47-
print 'pixeltype: %d, size %d'%(pixelType, pixelSize)
48-
print 'components: %d, size %d'%(cmpCount, cmpSize)
49-
print 'planeBytes: %d (0x%x)'%(planeBytes, planeBytes)
50-
print 'pmTable: 0x%x'%pmTable
51-
print 'pmReserved: 0x%x'%pmReserved
41+
print('Base: 0x%x'%baseAddr)
42+
print('rowBytes: %d (0x%x)'%(rowBytes&0x3fff, rowBytes))
43+
print('rect: %d, %d, %d, %d'%(t, l, b, r))
44+
print('pmVersion: 0x%x'%pmVersion)
45+
print('packing: %d %d'%(packType, packSize))
46+
print('resolution: %f x %f'%(float(hRes)/0x10000, float(vRes)/0x10000))
47+
print('pixeltype: %d, size %d'%(pixelType, pixelSize))
48+
print('components: %d, size %d'%(cmpCount, cmpSize))
49+
print('planeBytes: %d (0x%x)'%(planeBytes, planeBytes))
50+
print('pmTable: 0x%x'%pmTable)
51+
print('pmReserved: 0x%x'%pmReserved)
5252
for i in range(0, len(data), 16):
5353
for j in range(16):
5454
if i + j < len(data):
55-
print '%02.2x'%ord(data[i+j]),
56-
print
55+
print('%02.2x'%ord(data[i+j]), end=' ')
56+
print()

Mac/Demo/quicktime/VerySimplePlayer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# XXXX maxbounds = (40, 40, 1000, 1000)
1919

2020
def main():
21-
print 'hello world' # XXXX
21+
print('hello world') # XXXX
2222
# skip the toolbox initializations, already done
2323
# XXXX Should use gestalt here to check for quicktime version
2424
Qt.EnterMovies()
@@ -75,7 +75,7 @@ def main():
7575
whichWindow = Win.WhichWindow(message)
7676
if not whichWindow:
7777
# Probably the console window. Print something, hope it helps.
78-
print 'update'
78+
print('update')
7979
else:
8080
Qd.SetPort(whichWindow)
8181
whichWindow.BeginUpdate()

Mac/Demo/resources/copyres.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,23 @@ def copyres(src, dst):
3434
id, type, name = res.GetResInfo()
3535
size = res.SizeResource()
3636
attrs = res.GetResAttrs()
37-
print id, type, name, size, hex(attrs)
37+
print(id, type, name, size, hex(attrs))
3838
res.DetachResource()
3939
UseResFile(output)
4040
try:
4141
res2 = Get1Resource(type, id)
4242
except (RuntimeError, Res.Error) as msg:
4343
res2 = None
4444
if res2:
45-
print "Duplicate type+id, not copied"
45+
print("Duplicate type+id, not copied")
4646
print (res2.size, res2.data)
47-
print res2.GetResInfo()
47+
print(res2.GetResInfo())
4848
if res2.HomeResFile() == output:
4949
'OK'
5050
elif res2.HomeResFile() == input:
5151
'BAD!'
5252
else:
53-
print 'Home:', res2.HomeResFile()
53+
print('Home:', res2.HomeResFile())
5454
else:
5555
res.AddResource(type, id, name)
5656
#res.SetResAttrs(attrs)

Mac/Demo/resources/listres.py

Lines changed: 5 additions & 5 deletions

0 commit comments

Comments
 (0)