From 0319c665fe5bf0ecca06ff15c891987d4d0b32cf Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 9 Feb 2010 02:09:10 +0100 Subject: [PATCH] experimental Python 3 support. --HG-- branch : trunk --- CHANGES | 1 + jinja2/environment.py | 6 +++--- setup.py | 8 +++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 1b6f7d6..4241487 100644 --- a/CHANGES +++ b/CHANGES @@ -20,6 +20,7 @@ Version 2.3 now. (#364) - added support for translator comments if extracted via babel. - added with-statement extension. +- experimental Python 3 support. Version 2.2.1 ------------- diff --git a/jinja2/environment.py b/jinja2/environment.py index 2f72ecc..9ee3fb7 100644 --- a/jinja2/environment.py +++ b/jinja2/environment.py @@ -475,7 +475,7 @@ class Environment(object): >>> env.compile_expression('var', undefined_to_none=False)() Undefined - **new in Jinja 2.1** + .. versionadded:: 2.1 """ parser = Parser(self, source, state='variable') exc_info = None @@ -564,7 +564,7 @@ class Environment(object): before it fails. If it cannot find any of the templates, it will raise a :exc:`TemplatesNotFound` exception. - .. versionadded:: 2.2 + .. versionadded:: 2.3 """ if not names: raise TemplatesNotFound(message=u'Tried to select from an empty list ' @@ -586,7 +586,7 @@ class Environment(object): Does a typecheck and dispatches to :meth:`select_template` if an iterable of template names is given, otherwise to :meth:`get_template`. - .. versionadded:: 2.2 + .. versionadded:: 2.3 """ if isinstance(template_name_or_list, basestring): return self.get_template(template_name_or_list, parent, globals) diff --git a/setup.py b/setup.py index 09998a4..5e9efcb 100644 --- a/setup.py +++ b/setup.py @@ -46,6 +46,11 @@ from setuptools import setup, Extension, Feature from distutils.command.build_ext import build_ext from distutils.errors import CCompilerError, DistutilsPlatformError +try: + from distutils.command.build_py import build_py_2to3 as build_py +except ImportError: + from distutils.command.build_py import build_py + setup( name='Jinja2', @@ -83,5 +88,6 @@ setup( entry_points=""" [babel.extractors] jinja2 = jinja2.ext:babel_extract[i18n] - """ + """, + cmdclass=dict(build_py=build_py) ) -- 2.26.2