mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
python: Use the unicode_escape codec
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>
This commit is contained in:
parent
ad363913e6
commit
91939255a7
2 changed files with 2 additions and 2 deletions
|
|
@ -65,7 +65,7 @@ class StringTable:
|
|||
"""
|
||||
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
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class StringTable:
|
|||
"""
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue