servo: Merge #10527 - Work around a Mako bug on Windows (from servo:cr); r=larsbergstrom

http://logs.glob.uno/?c=mozilla%23servo#c403766
https://i.imgur.com/j5Zv4LX.png
https://bitbucket.org/zzzeek/mako/issues/150/line-ending-handling-broken-on-win32

r? @larsbergstrom

Source-Repo: https://github.com/servo/servo
Source-Revision: 11927da1659baec54102fa4609001f073216d7b3
This commit is contained in:
Simon Sapin 2016-04-12 06:44:22 +05:01
parent 1257225e1e
commit a095bdc18b

View File

@ -50,8 +50,8 @@ import sys
from mako.template import Template
from mako import exceptions
try:
print(Template(filename=os.environ['TEMPLATE'], input_encoding='utf8').render(PRODUCT=os.environ['PRODUCT'])
.encode('utf8'))
template = Template(open(os.environ['TEMPLATE'], 'rb').read(), input_encoding='utf8')
print(template.render(PRODUCT=os.environ['PRODUCT']).encode('utf8'))
except:
sys.stderr.write(exceptions.text_error_template().render().encode('utf8'))
sys.exit(1)