summaryrefslogtreecommitdiffstats
path: root/Lib/lib2to3/fixes/fix_print.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/lib2to3/fixes/fix_print.py')
-rw-r--r--Lib/lib2to3/fixes/fix_print.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/lib2to3/fixes/fix_print.py b/Lib/lib2to3/fixes/fix_print.py
index 134a972..abce251 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("print"), [],
- prefix=bare_print.get_prefix()))
+ prefix=bare_print.prefix))
return
assert node.children[0] == Name("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("")
+ l_args[0].prefix = ""
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, "sep", String(repr(sep)))
@@ -74,17 +74,17 @@ class FixPrint(fixer_base.ConditionalFix):
if file is not None:
self.add_kwarg(l_args, "file", file)
n_stmt = Call(Name("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("")
+ n_expr.prefix = ""
n_argument = pytree.Node(self.syms.argument,
(Name(s_kwd),
pytree.Leaf(token.EQUAL, "="),
n_expr))
if l_nodes:
l_nodes.append(Comma())
- n_argument.set_prefix(" ")
+ n_argument.prefix = " "
l_nodes.append(n_argument)