diff options
Diffstat (limited to 'Lib/lib2to3/fixes/fix_print.py')
| -rw-r--r-- | Lib/lib2to3/fixes/fix_print.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/lib2to3/fixes/fix_print.py b/Lib/lib2to3/fixes/fix_print.py index d3aa974..be29dce 100644 --- a/Lib/lib2to3/fixes/fix_print.py +++ b/Lib/lib2to3/fixes/fix_print.py @@ -45,7 +45,7 @@ class FixPrint(fixer_base.ConditionalFix): if bare_print: # Special-case print all by itself bare_print.replace(Call(Name(u"print"), [], - prefix=bare_print.get_prefix())) + prefix=bare_print.prefix)) return assert node.children[0] == Name(u"print") args = node.children[1:] @@ -65,7 +65,7 @@ class FixPrint(fixer_base.ConditionalFix): # Now synthesize a print(args, sep=..., end=..., file=...) node. l_args = [arg.clone() for arg in args] if l_args: - l_args[0].set_prefix(u"") + l_args[0].prefix = u"" if sep is not None or end is not None or file is not None: if sep is not None: self.add_kwarg(l_args, u"sep", String(repr(sep))) @@ -74,17 +74,17 @@ class FixPrint(fixer_base.ConditionalFix): if file is not None: self.add_kwarg(l_args, u"file", file) n_stmt = Call(Name(u"print"), l_args) - n_stmt.set_prefix(node.get_prefix()) + n_stmt.prefix = node.prefix return n_stmt def add_kwarg(self, l_nodes, s_kwd, n_expr): # XXX All this prefix-setting may lose comments (though rarely) - n_expr.set_prefix(u"") + n_expr.prefix = u"" n_argument = pytree.Node(self.syms.argument, (Name(s_kwd), pytree.Leaf(token.EQUAL, u"="), n_expr)) if l_nodes: l_nodes.append(Comma()) - n_argument.set_prefix(u" ") + n_argument.prefix = u" " l_nodes.append(n_argument) |
