| OLD | NEW |
| 1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
| 2 """ | 2 """ |
| 3 markupsafe._compat | 3 markupsafe._compat |
| 4 ~~~~~~~~~~~~~~~~~~ | 4 ~~~~~~~~~~~~~~~~~~ |
| 5 | 5 |
| 6 Compatibility module for different Python versions. | 6 Compatibility module for different Python versions. |
| 7 | 7 |
| 8 :copyright: (c) 2013 by Armin Ronacher. | 8 :copyright: (c) 2013 by Armin Ronacher. |
| 9 :license: BSD, see LICENSE for more details. | 9 :license: BSD, see LICENSE for more details. |
| 10 """ | 10 """ |
| 11 import sys | 11 import sys |
| 12 | 12 |
| 13 PY2 = sys.version_info[0] == 2 | 13 PY2 = sys.version_info[0] == 2 |
| 14 | 14 |
| 15 if not PY2: | 15 if not PY2: |
| 16 text_type = str | 16 text_type = str |
| 17 string_types = (str,) | 17 string_types = (str,) |
| 18 unichr = chr | 18 unichr = chr |
| 19 int_types = (int,) | 19 int_types = (int,) |
| 20 else: | 20 else: |
| 21 text_type = unicode | 21 text_type = unicode |
| 22 string_types = (str, unicode) | 22 string_types = (str, unicode) |
| 23 unichr = unichr | 23 unichr = unichr |
| 24 int_types = (int, long) | 24 int_types = (int, long) |
| OLD | NEW |