blob: 8c1963c497cf46913b77482fefbf3cdcdf0a015e [file] [log] [blame]
Thomas Waldmanna2cf1d32013-05-18 13:08:53 +02001# -*- coding: utf-8 -*-
2"""
3 jinja2._compat
4 ~~~~~~~~~~~~~~
5
Thomas Waldmann05ace8b2013-05-18 13:14:14 +02006 Some py2/py3 compatibility support that is not yet available in
Armin Ronacher4a41dd62013-05-19 13:47:33 +01007 "six" 1.3.0. Generally all uses of six should go through this module
8 so that we have one central place to remove stuff from when we
9 eventually drop 2.x.
Thomas Waldmanna2cf1d32013-05-18 13:08:53 +020010
11 :copyright: Copyright 2013 by the Jinja team, see AUTHORS.
12 :license: BSD, see LICENSE for details.
13"""
Armin Ronacherc87d4cf2013-05-19 13:46:22 +010014import six
Thomas Waldmanna2cf1d32013-05-18 13:08:53 +020015
16# https://bitbucket.org/gutworth/six/issue/25/add-unichr
17try:
18 unichr = unichr # py2
19except NameError:
20 unichr = chr # py3
Armin Ronacherf6b4b042013-05-18 12:23:30 +010021
Armin Ronacherc87d4cf2013-05-19 13:46:22 +010022range_type = six.moves.xrange
23next = six.advance_iterator
24imap = six.moves.map