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.)
This commit is contained in:
Guido van Rossum 2007-02-09 05:37:30 +00:00
parent 452bf519a7
commit be19ed77dd
331 changed files with 2567 additions and 2648 deletions

View file

@ -19,10 +19,10 @@ def __init__(self):
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 @@ def _disable_debug(self):
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 @@ def dump(self, io=None):
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 @@ def makeByteCode(self):
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 @@ def findDepth(self, insts, debug=0):
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 @@ def findDepth(self, insts, debug=0):
if depth > maxDepth:
maxDepth = depth
if debug:
print depth, maxDepth
print(depth, maxDepth)
return maxDepth
effect = {