1.1 --- a/compiler/transformer.py Sat Feb 04 00:12:06 2017 +0100
1.2 +++ b/compiler/transformer.py Sat Feb 04 15:35:58 2017 +0100
1.3 @@ -669,15 +669,22 @@
1.4
1.5 def decode_literal(self, lit):
1.6 if self.encoding:
1.7 + # this is particularly fragile & a bit of a
1.8 + # hack... changes in compile.c:parsestr and
1.9 + # tokenizer.c must be reflected here.
1.10 + if self.encoding != 'utf-8':
1.11 + lit = unicode(lit, 'utf-8').encode(self.encoding)
1.12 return eval("# coding: %s\n%s" % (self.encoding, lit))
1.13 else:
1.14 return eval(lit)
1.15
1.16 def atom_string(self, nodelist):
1.17 k = ''
1.18 + l = []
1.19 for node in nodelist:
1.20 k += self.decode_literal(node[1])
1.21 - return Const(k, node[1], lineno=nodelist[0][2])
1.22 + l.append(node[1])
1.23 + return Const(k, l, lineno=nodelist[0][2])
1.24
1.25 def atom_name(self, nodelist):
1.26 return Name(nodelist[0][1], lineno=nodelist[0][2])