Python 2 had string_escape and unicode_escape codecs. Python 3 only has
the latter. These work the same as far as we're concerned, so let's use
the future-proof one.
However, the reste of the code expects unicode strings, so we need to
decode them again.
Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
"""
fragments = [
'"%s\\0" /* %s */' % (
- te[0].encode('string_escape'),
+ te[0].encode('unicode_escape').decode(),
', '.join(str(idx) for idx in sorted(te[2]))
)
for te in self.table
"""
fragments = [
'"%s\\0" /* %s */' % (
- te[0].encode('string_escape'),
+ te[0].encode('unicode_escape').decode(),
', '.join(str(idx) for idx in te[2])
)
for te in self.table