aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/lib2to3/fixes/fix_execfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/lib2to3/fixes/fix_execfile.py')
-rw-r--r--Lib/lib2to3/fixes/fix_execfile.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/lib2to3/fixes/fix_execfile.py b/Lib/lib2to3/fixes/fix_execfile.py
index 2f29d3b281a..09cb6f6661c 100644
--- a/Lib/lib2to3/fixes/fix_execfile.py
+++ b/Lib/lib2to3/fixes/fix_execfile.py
@@ -32,21 +32,21 @@ class FixExecfile(fixer_base.BaseFix):
execfile_paren = node.children[-1].children[-1].clone()
# Construct open().read().
open_args = ArgList([filename.clone()], rparen=execfile_paren)
- open_call = Node(syms.power, [Name(u"open"), open_args])
- read = [Node(syms.trailer, [Dot(), Name(u'read')]),
+ open_call = Node(syms.power, [Name("open"), open_args])
+ read = [Node(syms.trailer, [Dot(), Name('read')]),
Node(syms.trailer, [LParen(), RParen()])]
open_expr = [open_call] + read
# Wrap the open call in a compile call. This is so the filename will be
# preserved in the execed code.
filename_arg = filename.clone()
- filename_arg.prefix = u" "
- exec_str = String(u"'exec'", u" ")
+ filename_arg.prefix = " "
+ exec_str = String("'exec'", " ")
compile_args = open_expr + [Comma(), filename_arg, Comma(), exec_str]
- compile_call = Call(Name(u"compile"), compile_args, u"")
+ compile_call = Call(Name("compile"), compile_args, "")
# Finally, replace the execfile call with an exec call.
args = [compile_call]
if globals is not None:
args.extend([Comma(), globals.clone()])
if locals is not None:
args.extend([Comma(), locals.clone()])
- return Call(Name(u"exec"), args, prefix=node.prefix)
+ return Call(Name("exec"), args, prefix=node.prefix)