[Python-checkins] cpython: Tidy up comments from dd4f7d5c51c7 (zlib compression dictionary support).
nadeem.vawda
python-checkins at python.org
Fri Jun 22 01:51:40 CEST 2012
http://hg.python.org/cpython/rev/4931cbc58cde
changeset: 77558:4931cbc58cde
user: Nadeem Vawda <nadeem.vawda at gmail.com>
date: Fri Jun 22 00:35:57 2012 +0200
summary:
Tidy up comments from dd4f7d5c51c7 (zlib compression dictionary support).
files:
Lib/test/test_zlib.py | 13 ++++++-------
Modules/zlibmodule.c | 2 +-
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py
--- a/Lib/test/test_zlib.py
+++ b/Lib/test/test_zlib.py
@@ -427,24 +427,23 @@
def test_dictionary(self):
h = HAMLET_SCENE
- # build a simulated dictionary out of the words in HAMLET
+ # Build a simulated dictionary out of the words in HAMLET.
words = h.split()
random.shuffle(words)
zdict = b''.join(words)
- # use it to compress HAMLET
+ # Use it to compress HAMLET.
co = zlib.compressobj(zdict=zdict)
cd = co.compress(h) + co.flush()
- # verify that it will decompress with the dictionary
+ # Verify that it will decompress with the dictionary.
dco = zlib.decompressobj(zdict=zdict)
self.assertEqual(dco.decompress(cd) + dco.flush(), h)
- # verify that it fails when not given the dictionary
+ # Verify that it fails when not given the dictionary.
dco = zlib.decompressobj()
self.assertRaises(zlib.error, dco.decompress, cd)
def test_dictionary_streaming(self):
- # this is simulating the needs of SPDY to be able to reuse the same
- # stream object (with its compression state) between sets of compressed
- # headers.
+ # This simulates the reuse of a compressor object for compressing
+ # several separate data streams.
co = zlib.compressobj(zdict=HAMLET_SCENE)
do = zlib.decompressobj(zdict=HAMLET_SCENE)
piece = HAMLET_SCENE[1000:1500]
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c
--- a/Modules/zlibmodule.c
+++ b/Modules/zlibmodule.c
@@ -619,7 +619,7 @@
RetVal = NULL;
goto error;
}
- /* repeat the call to inflate! */
+ /* Repeat the call to inflate. */
Py_BEGIN_ALLOW_THREADS
err = inflate(&(self->zst), Z_SYNC_FLUSH);
Py_END_ALLOW_THREADS
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list