Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/lib2to3/fixes/fix_unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def transform(self, node, results):
if val[0] in 'uU':
val = val[1:]
if val == node.value:
return node
return None
new = node.clone()
new.value = val
return new
9 changes: 5 additions & 4 deletions Lib/lib2to3/pytree.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,12 @@ def replace(self, new):
else:
l_children.append(ch)
assert found, (self.children, self, new)
self.parent.changed()
self.parent.children = l_children
parent = self.parent
self.parent = None
parent.children = l_children
for x in new:
x.parent = self.parent
self.parent = None
x.parent = parent
parent.changed()

def get_lineno(self):
"""Return the line number which generated the invocant node."""
Expand Down