1
# -*- coding: utf-8 -*-
4
Contains common Python2-Python3 compatibility
5
When extending this, please let yourself be inspired by mitsuhiko:
6
http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/
8
text_type is to be used instead of `unicode` in python 2:
9
e.g. my_str += text_type(my_exception)
11
string_types is to be used instead of basestring:
12
i.e. if isinstance(my_obj, string_types): ...
16
PY2 = sys.version_info[0] == 2
23
string_types = (str, unicode)