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.

28 lines
536 B

4 years ago
  1. """
  2. Compatibility Support for Python 2.7 and earlier
  3. """
  4. import platform
  5. from setuptools.extern import six
  6. def get_all_headers(message, key):
  7. """
  8. Given an HTTPMessage, return all headers matching a given key.
  9. """
  10. return message.get_all(key)
  11. if six.PY2:
  12. def get_all_headers(message, key):
  13. return message.getheaders(key)
  14. linux_py2_ascii = (
  15. platform.system() == 'Linux' and
  16. six.PY2
  17. )
  18. rmtree_safe = str if linux_py2_ascii else lambda x: x
  19. """Workaround for http://bugs.python.org/issue24672"""