
import sys

# PY3 is left as bw-compat but PY2 should be used for most checks.
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3

if PY2:
    text_type = unicode
else:
    text_type = str

try:
    from pyramid.compat import urlparse
except ImportError:
    from urllib import parse
    urlparse = parse