25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
536B

  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"""