Rip out all the u"..." literals and calls to unicode().

This commit is contained in:
Guido van Rossum 2007-05-02 19:09:54 +00:00
parent 572dbf8f13
commit ef87d6ed94
200 changed files with 18074 additions and 18074 deletions

View file

@ -740,7 +740,7 @@ class Transformer:
# hack... changes in compile.c:parsestr and
# tokenizer.c must be reflected here.
if self.encoding not in ['utf-8', 'iso-8859-1']:
lit = unicode(lit, 'utf-8').encode(self.encoding)
lit = str(lit, 'utf-8').encode(self.encoding)
return eval("# coding: %s\n%s" % (self.encoding, lit))
else:
return eval(lit)
@ -750,7 +750,7 @@ class Transformer:
for node in nodelist[1:]:
k += self.decode_literal(node[1])
if isinstance(k, bytes):
return Bytes(str(k), lineno=nodelist[0][2])
return Bytes(str(k), lineno=nodelist[0][2])
return Const(k, lineno=nodelist[0][2])
def atom_ellipsis(self, nodelist):
@ -825,7 +825,7 @@ class Transformer:
else:
annotation = None
return SimpleArg(name, annotation, lineno)
def com_arglist(self, nodelist):
# varargslist:
# (fpdef ['=' test] ',')*