diff options
author | Marc Abramowitz <marc@marc-abramowitz.com> | 2015-04-30 07:27:52 -0700 |
---|---|---|
committer | Marc Abramowitz <marc@marc-abramowitz.com> | 2015-04-30 07:27:52 -0700 |
commit | 740fd18c1568047b1bf45ec76f5a3a500c46aff6 (patch) | |
tree | 9a691eac8505520484fd732e5a0ee475deacf92c | |
parent | e123234948e8fac18f21d69da3b3b7f49969106c (diff) | |
download | paste-git-740fd18c1568047b1bf45ec76f5a3a500c46aff6.tar.gz |
Make get_headers default to Python 3; fallback to Python 2
as suggested by @haypo at https://bitbucket.org/ianb/paste/pull-request/22/fix-improper-commas-in-request-headers-in/diff#comment-6583636
-rwxr-xr-x | paste/httpserver.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/paste/httpserver.py b/paste/httpserver.py index 6172251..f1fe476 100755 --- a/paste/httpserver.py +++ b/paste/httpserver.py @@ -44,10 +44,10 @@ __version__ = "0.5" def get_headers(headers, k): - if hasattr(headers, 'getheaders'): # Python 2 - return headers.getheaders(k) - if hasattr(headers, 'get_all'): # Python 3 - return headers.get_all(k) + if hasattr(headers, 'get_all'): + return headers.get_all(k) # Python 3 + else: + return headers.getheaders(k) # Python 2 class ContinueHook(object): |