Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Unified Diff: build/android/gyp/jinja_template.py

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/android/gyp/jinja_template.py
diff --git a/build/android/gyp/jinja_template.py b/build/android/gyp/jinja_template.py
index 8e579aa6a3df3eebb7f5e0bed2cf2859f2906a06..3a93f746fe14891caef4d3aaf6a3377ab2b4fc9e 100755
--- a/build/android/gyp/jinja_template.py
+++ b/build/android/gyp/jinja_template.py
@@ -6,6 +6,7 @@
"""Renders one or more template files using the Jinja template engine."""
+import codecs
import optparse
import os
import sys
@@ -18,13 +19,13 @@ import jinja2 # pylint: disable=F0401
def ProcessFile(input_filename, output_filename, variables):
- with open(input_filename, 'r') as input_file:
+ with codecs.open(input_filename, 'r', 'utf-8') as input_file:
input_ = input_file.read()
env = jinja2.Environment(undefined=jinja2.StrictUndefined)
template = env.from_string(input_)
template.filename = os.path.abspath(input_filename)
output = template.render(variables)
- with open(output_filename, 'w') as output_file:
+ with codecs.open(output_filename, 'w', 'utf-8') as output_file:
output_file.write(output)

Powered by Google App Engine
This is Rietveld 408576698