summaryrefslogtreecommitdiffstats
path: root/Lib/compiler/pyassem.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-09 05:37:30 (GMT)
commitbe19ed77ddb047e02fe94d142181062af6d99dcc (patch)
tree70f214e06554046fcccbadeb78665f25e07ce965 /Lib/compiler/pyassem.py
parent452bf519a70c3db0e7f0d2540b1bfb07d9085583 (diff)
downloadcpython-be19ed77ddb047e02fe94d142181062af6d99dcc.zip
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.gz
cpython-be19ed77ddb047e02fe94d142181062af6d99dcc.tar.bz2
Fix most trivially-findable print statements.
There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
Diffstat (limited to 'Lib/compiler/pyassem.py')
-rw-r--r--Lib/compiler/pyassem.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/Lib/compiler/pyassem.py b/Lib/compiler/pyassem.py
index 86e2c49..9f45d61 100644
--- a/Lib/compiler/pyassem.py
+++ b/Lib/compiler/pyassem.py
@@ -19,10 +19,10 @@ class FlowGraph:
def startBlock(self, block):
if self._debug:
if self.current:
- print "end", repr(self.current)
- print " next", self.current.next
- print " ", self.current.get_children()
- print repr(block)
+ print("end", repr(self.current))
+ print(" next", self.current.next)
+ print(" ", self.current.get_children())
+ print(repr(block))
self.current = block
def nextBlock(self, block=None):
@@ -68,7 +68,7 @@ class FlowGraph:
def emit(self, *inst):
if self._debug:
- print "\t", inst
+ print("\t", inst)
if inst[0] in ['RETURN_VALUE', 'YIELD_VALUE']:
self.current.addOutEdge(self.exit)
if len(inst) == 2 and isinstance(inst[1], Block):
@@ -400,12 +400,12 @@ class PyFlowGraph(FlowGraph):
for t in self.insts:
opname = t[0]
if opname == "SET_LINENO":
- print
+ print()
if len(t) == 1:
- print "\t", "%3d" % pc, opname
+ print("\t", "%3d" % pc, opname)
pc = pc + 1
else:
- print "\t", "%3d" % pc, opname, t[1]
+ print("\t", "%3d" % pc, opname, t[1])
pc = pc + 3
if io:
sys.stdout = save
@@ -601,8 +601,8 @@ class PyFlowGraph(FlowGraph):
try:
lnotab.addCode(self.opnum[opname], lo, hi)
except ValueError:
- print opname, oparg
- print self.opnum[opname], lo, hi
+ print(opname, oparg)
+ print(self.opnum[opname], lo, hi)
raise
self.stage = DONE
@@ -744,7 +744,7 @@ class StackDepthTracker:
for i in insts:
opname = i[0]
if debug:
- print i,
+ print(i, end=' ')
delta = self.effect.get(opname, None)
if delta is not None:
depth = depth + delta
@@ -763,7 +763,7 @@ class StackDepthTracker:
if depth > maxDepth:
maxDepth = depth
if debug:
- print depth, maxDepth
+ print(depth, maxDepth)
return maxDepth
effect = {