diff options
author | Mathieu Bridon <[email protected]> | 2018-08-17 09:33:02 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-08-17 09:33:16 -0600 |
commit | f9415d760af0bfd00b579c96e5ac866db43e38fe (patch) | |
tree | f594da0a86e9637a71c9d98a5f0fd811af04b160 /src/util/xmlpool/gen_xmlpool.py | |
parent | a8ef7f5e027b5e1c281dc9aec4ea49763373e568 (diff) |
python: Help Python 2 print the line
Reviewed-by: Jose Fonseca <jfonseca@vmware>
Diffstat (limited to 'src/util/xmlpool/gen_xmlpool.py')
-rw-r--r-- | src/util/xmlpool/gen_xmlpool.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util/xmlpool/gen_xmlpool.py b/src/util/xmlpool/gen_xmlpool.py index 327709c7f8d..64e631f74c4 100644 --- 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() |