You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
647 B

4 years ago
  1. try:
  2. from urllib.parse import urljoin
  3. except ImportError:
  4. from urlparse import urljoin
  5. try:
  6. import cPickle as pickle
  7. except ImportError:
  8. import pickle
  9. # Handle the case where the requests module has been patched to not have
  10. # urllib3 bundled as part of its source.
  11. try:
  12. from requests.packages.urllib3.response import HTTPResponse
  13. except ImportError:
  14. from urllib3.response import HTTPResponse
  15. try:
  16. from requests.packages.urllib3.util import is_fp_closed
  17. except ImportError:
  18. from urllib3.util import is_fp_closed
  19. # Replicate some six behaviour
  20. try:
  21. text_type = unicode
  22. except NameError:
  23. text_type = str