diff --git a/Lib/lib2to3/fixes/fix_sys_exc.py b/Lib/lib2to3/fixes/fix_sys_exc.py index 58bbabbc44e..348929bb6ed 100644 --- a/Lib/lib2to3/fixes/fix_sys_exc.py +++ b/Lib/lib2to3/fixes/fix_sys_exc.py @@ -20,7 +20,7 @@ class FixSysExc(fixer_base.BaseFix): def transform(self, node, results): sys_attr = results["attribute"][0] - index = Number(unicode(self.exc_info.index(sys_attr.value))) + index = Number(self.exc_info.index(sys_attr.value)) call = Call(Name(u"exc_info"), prefix=sys_attr.prefix) attr = Attr(Name(u"sys"), call) diff --git a/Lib/lib2to3/refactor.py b/Lib/lib2to3/refactor.py index 5982ed06c14..3e94699f3d5 100644 --- a/Lib/lib2to3/refactor.py +++ b/Lib/lib2to3/refactor.py @@ -564,7 +564,9 @@ class RefactoringTool(object): This is necessary to get correct line number / offset information in the parser diagnostics and embedded into the parse tree. """ - return self.driver.parse_tokens(self.wrap_toks(block, lineno, indent)) + tree = self.driver.parse_tokens(self.wrap_toks(block, lineno, indent)) + tree.future_features = frozenset() + return tree def wrap_toks(self, block, lineno, indent): """Wraps a tokenize stream to systematically modify start/end."""