diff options
author | Robert Brewer <fumanchu@aminus.org> | 2009-06-02 06:18:46 +0000 |
---|---|---|
committer | Robert Brewer <fumanchu@aminus.org> | 2009-06-02 06:18:46 +0000 |
commit | 24eeeaa5f4564b624e71474db8ac88dda4def909 (patch) | |
tree | 20287f051a0be071e379fc92e1dfe212711e6afe /cherrypy/lib/encoding.py | |
parent | 0e9ba795eaa87227ee6dae164a32286740c185ae (diff) | |
download | cherrypy-git-24eeeaa5f4564b624e71474db8ac88dda4def909.tar.gz |
trunk: A bunch more alignments between trunk and python3 syntax.
Diffstat (limited to 'cherrypy/lib/encoding.py')
-rw-r--r-- | cherrypy/lib/encoding.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cherrypy/lib/encoding.py b/cherrypy/lib/encoding.py index 095ab2ae..d5886af1 100644 --- a/cherrypy/lib/encoding.py +++ b/cherrypy/lib/encoding.py @@ -195,7 +195,6 @@ def compress(body, compress_level): # ISIZE: 4 bytes yield struct.pack("<L", size & 0xFFFFFFFFL) - def decompress(body): import gzip from cherrypy.py3util import StringIO @@ -256,7 +255,7 @@ def gzip(compress_level=5, mime_types=['text/html', 'text/plain']): # Return a generator that compresses the page response.headers['Content-Encoding'] = 'gzip' response.body = compress(response.body, compress_level) - if response.headers.has_key("Content-Length"): + if "Content-Length" in response.headers: # Delete Content-Length header so finalize() recalcs it. del response.headers["Content-Length"] return |