Coverage for requests/compat.py : 55%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*-
requests.compat ~~~~~~~~~~~~~~~
This module handles import compatibility issues between Python 2 and Python 3. """
# ------- # Pythons # -------
# Syntax sugar.
#: Python 2.x?
#: Python 3.x?
except ImportError: import json
# --------- # Specifics # ---------
from urllib import ( quote, unquote, quote_plus, unquote_plus, urlencode, getproxies, proxy_bypass, proxy_bypass_environment, getproxies_environment) from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag from urllib2 import parse_http_list import cookielib from Cookie import Morsel from StringIO import StringIO
try: from collections import OrderedDict # py2.7+ except: from ordereddict import OrderedDict # py2.6 and lower (el6, etc.
builtin_str = str bytes = str str = unicode basestring = basestring numeric_types = (int, long, float) integer_types = (int, long)
|