summaryrefslogtreecommitdiff
path: root/mako/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'mako/util.py')
-rw-r--r--mako/util.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mako/util.py b/mako/util.py
index 498edbc..16e3c72 100644
--- a/mako/util.py
+++ b/mako/util.py
@@ -3,7 +3,9 @@
#
# 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