File: compat.py

package info (click to toggle)
python-elasticsearch 1.4.0-2~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 636 kB
  • sloc: python: 3,209; makefile: 155
file content (13 lines) | stat: -rw-r--r-- 312 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
import sys

PY2 = sys.version_info[0] == 2

if PY2:
    string_types = basestring,
    from urllib import quote_plus, urlencode
    from urlparse import  urlparse
    from itertools import imap as map
else:
    string_types = str, bytes
    from urllib.parse import quote_plus, urlencode, urlparse
    map = map