diff options
Diffstat (limited to 'Lib/lib2to3/fixes/fix_throw.py')
-rw-r--r-- | Lib/lib2to3/fixes/fix_throw.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/lib2to3/fixes/fix_throw.py b/Lib/lib2to3/fixes/fix_throw.py index bf86d84..90ffc64 100644 --- a/Lib/lib2to3/fixes/fix_throw.py +++ b/Lib/lib2to3/fixes/fix_throw.py @@ -32,7 +32,7 @@ class FixThrow(fixer_base.BaseFix): return # Leave "g.throw(E)" alone - val = results.get("val") + val = results.get(u"val") if val is None: return @@ -40,17 +40,17 @@ class FixThrow(fixer_base.BaseFix): if is_tuple(val): args = [c.clone() for c in val.children[1:-1]] else: - val.set_prefix("") + val.set_prefix(u"") args = [val] throw_args = results["args"] if "tb" in results: tb = results["tb"].clone() - tb.set_prefix("") + tb.set_prefix(u"") e = Call(exc, args) - with_tb = Attr(e, Name('with_traceback')) + [ArgList([tb])] + with_tb = Attr(e, Name(u'with_traceback')) + [ArgList([tb])] throw_args.replace(pytree.Node(syms.power, with_tb)) else: throw_args.replace(Call(exc, args)) |