提交 617f1011 编写于 作者: D Dan Moldovan 提交者: TensorFlower Gardener

Avoid converting the old-style print statement, because it would otherwise generate a syntax error.

PiperOrigin-RevId: 258575670
上级 9eabc5c6
......@@ -142,22 +142,6 @@ class CallTreeTransformer(converter.Base):
return new_call
def visit_Print(self, node):
node = self.generic_visit(node)
args = node.values
# Following is the case when calling print(a, b)
if len(args) == 1 and isinstance(args[0], gast.Tuple):
args = args[0].elts
template = """
ag__.converted_call(func, None, options, args, {})
"""
return templates.replace_as_expression(
template,
func='print',
options=self.ctx.program.options.to_ast(),
args=args)
def transform(node, ctx):
"""Transform function call to the compiled counterparts.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册