File: compat.py

package info (click to toggle)
python-twilio 6.51.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 12,260 kB
  • sloc: python: 128,982; makefile: 51
file content (17 lines) | stat: -rw-r--r-- 517 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Those are not supported by the six library and needs to be done manually
try:
    # python 3
    from urllib.parse import urlencode, urlparse, urljoin, urlunparse, parse_qs
except ImportError:
    # python 2 backward compatibility
    # noinspection PyUnresolvedReferences
    from urllib import urlencode
    # noinspection PyUnresolvedReferences
    from urlparse import urlparse, urljoin, urlunparse, parse_qs

try:
    # python 2
    from itertools import izip
except ImportError:
    # python 3
    izip = zip