aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/lib2to3/fixes/fix_next.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/lib2to3/fixes/fix_next.py')
-rw-r--r--Lib/lib2to3/fixes/fix_next.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/lib2to3/fixes/fix_next.py b/Lib/lib2to3/fixes/fix_next.py
index f021a9bd70a..9f6305e1d49 100644
--- a/Lib/lib2to3/fixes/fix_next.py
+++ b/Lib/lib2to3/fixes/fix_next.py
@@ -36,7 +36,7 @@ class FixNext(fixer_base.BaseFix):
def start_tree(self, tree, filename):
super(FixNext, self).start_tree(tree, filename)
- n = find_binding(u'next', tree)
+ n = find_binding('next', tree)
if n:
self.warning(n, bind_warning)
self.shadowed_next = True
@@ -52,13 +52,13 @@ class FixNext(fixer_base.BaseFix):
if base:
if self.shadowed_next:
- attr.replace(Name(u"__next__", prefix=attr.prefix))
+ attr.replace(Name("__next__", prefix=attr.prefix))
else:
base = [n.clone() for n in base]
- base[0].prefix = u""
- node.replace(Call(Name(u"next", prefix=node.prefix), base))
+ base[0].prefix = ""
+ node.replace(Call(Name("next", prefix=node.prefix), base))
elif name:
- n = Name(u"__next__", prefix=name.prefix)
+ n = Name("__next__", prefix=name.prefix)
name.replace(n)
elif attr:
# We don't do this transformation if we're assigning to "x.next".
@@ -66,10 +66,10 @@ class FixNext(fixer_base.BaseFix):
# so it's being done here.
if is_assign_target(node):
head = results["head"]
- if "".join([str(n) for n in head]).strip() == u'__builtin__':
+ if "".join([str(n) for n in head]).strip() == '__builtin__':
self.warning(node, bind_warning)
return
- attr.replace(Name(u"__next__"))
+ attr.replace(Name("__next__"))
elif "global" in results:
self.warning(node, bind_warning)
self.shadowed_next = True