Files
opensearch-pyd/elasticsearch/compat.py
T
Honza Král a54d7035bb Compatibility with python 3.2
Now all the python 2/3 compatibility code is in elasticsearch.compat
Fixes #52
2014-02-21 16:59:13 +01:00

15 lines
315 B
Python

import sys
PY2 = sys.version_info[0] == 2
if PY2:
u = lambda s: s.decode('utf-8')
string_types = basestring,
from urllib import quote_plus, urlencode
from itertools import imap as map
else:
u = str
string_types = str, bytes
from urllib.parse import quote_plus, urlencode
map = map