Mini python 3 compatibility module. Based on Jinja2's _compat one.