mirror of
https://github.com/python/cpython.git
synced 2025-08-29 13:15:11 +00:00
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:
parent
452bf519a7
commit
be19ed77dd
331 changed files with 2567 additions and 2648 deletions
|
@ -112,7 +112,7 @@ class Module(AbstractCompileMode):
|
|||
gen = ModuleCodeGenerator(tree)
|
||||
if display:
|
||||
import pprint
|
||||
print pprint.pprint(tree)
|
||||
print(pprint.pprint(tree))
|
||||
self.code = gen.getCode()
|
||||
|
||||
def dump(self, f):
|
||||
|
@ -1018,7 +1018,7 @@ class CodeGenerator:
|
|||
self.set_lineno(node)
|
||||
self.delName(node.name)
|
||||
else:
|
||||
print "oops", node.flags
|
||||
print("oops", node.flags)
|
||||
|
||||
def visitAssAttr(self, node):
|
||||
self.visit(node.expr)
|
||||
|
@ -1027,8 +1027,8 @@ class CodeGenerator:
|
|||
elif node.flags == 'OP_DELETE':
|
||||
self.emit('DELETE_ATTR', self.mangle(node.attrname))
|
||||
else:
|
||||
print "warning: unexpected flags:", node.flags
|
||||
print node
|
||||
print("warning: unexpected flags:", node.flags)
|
||||
print(node)
|
||||
|
||||
def _visitAssSequence(self, node, op='UNPACK_SEQUENCE'):
|
||||
if findOp(node) != 'OP_DELETE':
|
||||
|
@ -1189,7 +1189,7 @@ class CodeGenerator:
|
|||
elif node.flags == 'OP_DELETE':
|
||||
self.emit('DELETE_SLICE+%d' % slice)
|
||||
else:
|
||||
print "weird slice", node.flags
|
||||
print("weird slice", node.flags)
|
||||
raise
|
||||
|
||||
def visitSubscript(self, node, aug_flag=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue