File: py27compat.py

package info (click to toggle)
python-setuptools 5.5.1-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,024 kB
  • ctags: 4,867
  • sloc: python: 24,503; xml: 846; makefile: 201; ansic: 198
file content (15 lines) | stat: -rw-r--r-- 306 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""
Compatibility Support for Python 2.7 and earlier
"""

import sys

def get_all_headers(message, key):
	"""
	Given an HTTPMessage, return all headers matching a given key.
	"""
	return message.get_all(key)

if sys.version_info < (3,):
	def get_all_headers(message, key):
		return message.getheaders(key)