projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a8ef7f5
)
python: Help Python 2 print the line
author
Mathieu Bridon
<bochecha@daitauha.fr>
Fri, 17 Aug 2018 15:33:02 +0000
(09:33 -0600)
committer
Brian Paul
<brianp@vmware.com>
Fri, 17 Aug 2018 15:33:16 +0000
(09:33 -0600)
Reviewed-by: Jose Fonseca <jfonseca@vmware>
src/util/xmlpool/gen_xmlpool.py
patch
|
blob
|
history
diff --git
a/src/util/xmlpool/gen_xmlpool.py
b/src/util/xmlpool/gen_xmlpool.py
index 327709c7f8ddac063b4235ad052f2ef4178e092f..64e631f74c43e3cd3948846bf33a40ee0c23b877 100644
(file)
--- a/
src/util/xmlpool/gen_xmlpool.py
+++ b/
src/util/xmlpool/gen_xmlpool.py
@@
-218,6
+218,11
@@
for line in template:
assert len(descMatches) == 0
descMatches = [matchDESC_BEGIN]
else:
+ # In Python 2, stdout expects encoded byte strings, or else it will
+ # encode them with the ascii 'codec'
+ if sys.version_info.major == 2:
+ line = line.encode('utf-8')
+
print(line, end='')
template.close()