summaryrefslogtreecommitdiff
path: root/Cython/Tempita
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2015-07-25 18:09:59 +0200
committerStefan Behnel <stefan_ml@behnel.de>2015-07-25 18:09:59 +0200
commitcaa2fe39d745680c616c091611f0e894832dd740 (patch)
tree4cf0289ef8c5627e8844ad2a922628272dfd6743 /Cython/Tempita
parent4a761906bea710b850693487318baaa375ecd4db (diff)
downloadcython-caa2fe39d745680c616c091611f0e894832dd740.tar.gz
make some imports compatible with Py2/Py3
Diffstat (limited to 'Cython/Tempita')
-rw-r--r--Cython/Tempita/_tempita.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Cython/Tempita/_tempita.py b/Cython/Tempita/_tempita.py
index 9d609ccfb..b766ceb69 100644
--- a/Cython/Tempita/_tempita.py
+++ b/Cython/Tempita/_tempita.py
@@ -29,6 +29,8 @@ can use ``__name='tmpl.html'`` to set the name of the template.
If there are syntax errors ``TemplateError`` will be raised.
"""
+from __future__ import absolute_import
+
import re
import sys
import cgi
@@ -38,12 +40,10 @@ except ImportError: # Py3
from urllib.parse import quote as url_quote
import os
import tokenize
-try:
- from io import StringIO
-except ImportError:
- from cStringIO import StringIO
-from Cython.Tempita._looper import looper
-from Cython.Tempita.compat3 import bytes, basestring_, next, is_unicode, coerce_text
+from io import StringIO
+
+from ._looper import looper
+from .compat3 import bytes, basestring_, next, is_unicode, coerce_text
__all__ = ['TemplateError', 'Template', 'sub', 'HTMLTemplate',
'sub_html', 'html', 'bunch']