Commit 732a31ff authored by John Budorick's avatar John Budorick Committed by Commit Bot

mojo: load ascii codec before importing jinja2.

This is a speculative fix for pickle failing to find the ascii codec
when jinja2 goes to import it. See crbug.com/912292#c2 for prior theory.

Bug: 997598
Change-Id: Ie52b72fbe7cbefeb58ea6dc0aaafa73e1d125bbf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1771554Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: John Budorick <jbudorick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690436}
parent bc18ca44
...@@ -4,9 +4,14 @@ ...@@ -4,9 +4,14 @@
# Based on third_party/WebKit/Source/build/scripts/template_expander.py. # Based on third_party/WebKit/Source/build/scripts/template_expander.py.
import codecs
import os.path import os.path
import sys import sys
# Cache the ascii codec to ensure pickle can find it at jinja2 import time.
# See https://crbug.com/997598#c5 for context.
codecs.lookup('ascii')
_current_dir = os.path.dirname(os.path.realpath(__file__)) _current_dir = os.path.dirname(os.path.realpath(__file__))
# jinja2 is in chromium's third_party directory # jinja2 is in chromium's third_party directory
# Insert at front to override system libraries, and after path[0] == script dir # Insert at front to override system libraries, and after path[0] == script dir
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment