OLD | NEW |
(Empty) | |
| 1 """ |
| 2 Compatibility Support for Python 2.7 and earlier |
| 3 """ |
| 4 |
| 5 import sys |
| 6 import platform |
| 7 |
| 8 |
| 9 def get_all_headers(message, key): |
| 10 """ |
| 11 Given an HTTPMessage, return all headers matching a given key. |
| 12 """ |
| 13 return message.get_all(key) |
| 14 |
| 15 |
| 16 if sys.version_info < (3,): |
| 17 |
| 18 def get_all_headers(message, key): |
| 19 return message.getheaders(key) |
| 20 |
| 21 |
| 22 linux_py2_ascii = ( |
| 23 platform.system() == 'Linux' and |
| 24 sys.getfilesystemencoding() == 'ascii' and |
| 25 sys.version_info < (3,) |
| 26 ) |
| 27 |
| 28 rmtree_safe = str if linux_py2_ascii else lambda x: x |
| 29 """Workaround for http://bugs.python.org/issue24672""" |
OLD | NEW |