Author: Łukasz Langa <[email protected]>
Branch:
Changeset: r95785:a03772d3a33a
Date: 2019-02-04 14:30 +0100
http://bitbucket.org/pypy/pypy/changeset/a03772d3a33a/
Log: (cfbolz,ambv) Rename zlib.compress argument for consistency
compressobj.compress() uses the name `data` for the first argument
whereas zlib.compress() used `string` before.
diff --git a/pypy/module/zlib/interp_zlib.py b/pypy/module/zlib/interp_zlib.py
--- a/pypy/module/zlib/interp_zlib.py
+++ b/pypy/module/zlib/interp_zlib.py
@@ -65,10 +65,10 @@
return OperationError(w_error, space.newtext(msg))
-@unwrap_spec(string='bufferstr', level=int)
-def compress(space, string, level=rzlib.Z_DEFAULT_COMPRESSION):
+@unwrap_spec(data='bufferstr', level=int)
+def compress(space, data, level=rzlib.Z_DEFAULT_COMPRESSION):
"""
- compress(string[, level]) -- Returned compressed string.
+ compress(data[, level]) -- Returned compressed string.
Optional arg level is the compression level, in 1-9.
"""
@@ -78,7 +78,7 @@
except ValueError:
raise zlib_error(space, "Bad compression level")
try:
- result = rzlib.compress(stream, string, rzlib.Z_FINISH)
+ result = rzlib.compress(stream, data, rzlib.Z_FINISH)
finally:
rzlib.deflateEnd(stream)
except rzlib.RZlibError as e:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit