mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-10 16:10:26 +01:00
python: Help Python 2 print the line
Reviewed-by: Jose Fonseca <jfonseca@vmware>
This commit is contained in:
parent
a8ef7f5e02
commit
f9415d760a
1 changed files with 5 additions and 0 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue