Update mako to 1.1.2

This commit is contained in:
JonnyWong16 2020-03-23 20:57:35 -07:00
parent 843a400b2d
commit 4564623884
27 changed files with 53 additions and 112 deletions

View file

@ -1,9 +1,11 @@
# mako/util.py
# Copyright 2006-2019 the Mako authors and contributors <see AUTHORS file>
# Copyright 2006-2020 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
from ast import parse
import codecs
import collections
import operator
@ -257,9 +259,7 @@ def parse_encoding(fp):
m = _PYTHON_MAGIC_COMMENT_re.match(line1.decode("ascii", "ignore"))
if not m:
try:
import parser
parser.suite(line1.decode("ascii", "ignore"))
parse(line1.decode("ascii", "ignore"))
except (ImportError, SyntaxError):
# Either it's a real syntax error, in which case the source
# is not valid python source, or line2 is a continuation of