Commit ee392622 authored by Wojciech Bielawski's avatar Wojciech Bielawski Committed by Commit Bot

Fix jinja2 template to support build on python3

Summary: Jinja2 already supports python3, but templates must be aware of
environment they're run on. This commit fixes 'str object' has no attribute 'values'
error when template is rendered using python3

Bug: 1138872
Change-Id: Iaf2f660369ff4857ee3307825944cf1d2accef3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2475118
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819800}
parent 05d27540
......@@ -25,7 +25,7 @@
{% macro trie_leaf(index, object, return_macro, lowercase_data) %}
{% set name, value = object.items()[0] %}
{% set name, value = (object.items()|list)[0] %}
{% if name|length %}
if (
{%- for c in name -%}
......@@ -45,7 +45,7 @@ return {{ return_macro(value) }};
{% macro trie_switch(trie, index, return_macro, lowercase_data) %}
{% if trie|length == 1 and trie.values()[0] is string %}
{% if trie|length == 1 and (trie.values()|list)[0] is string %}
{{ trie_leaf(index, trie, return_macro, lowercase_data) -}}
{% else %}
{% if lowercase_data %}
......
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