diff options
author | Zackery Spytz <zspytz@gmail.com> | 2018-06-27 12:04:51 -0600 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-06-27 21:04:51 +0300 |
commit | d2cbfffc842b00b5257aa1c25dbcdeb456b6a249 (patch) | |
tree | 9375c06924d055f372d4ecbce2e431200ef44576 /Modules/zlibmodule.c | |
parent | fbd7172325e6ce55b6d5d3d7603e4c1c8a219cb8 (diff) | |
download | cpython-git-d2cbfffc842b00b5257aa1c25dbcdeb456b6a249.tar.gz |
bpo-25007: Add copy protocol support to zlib compressors and decompressors (GH-7940)
Diffstat (limited to 'Modules/zlibmodule.c')
-rw-r--r-- | Modules/zlibmodule.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index cd587b4ac9..36a3835e42 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -985,6 +985,32 @@ error: } /*[clinic input] +zlib.Compress.__copy__ +[clinic start generated code]*/ + +static PyObject * +zlib_Compress___copy___impl(compobject *self) +/*[clinic end generated code: output=1875e6791975442e input=be97a05a788dfd83]*/ +{ + return zlib_Compress_copy_impl(self); +} + +/*[clinic input] +zlib.Compress.__deepcopy__ + + memo: object + / + +[clinic start generated code]*/ + +static PyObject * +zlib_Compress___deepcopy__(compobject *self, PyObject *memo) +/*[clinic end generated code: output=f47a2213282c9eb0 input=a9a8b0b40d83388e]*/ +{ + return zlib_Compress_copy_impl(self); +} + +/*[clinic input] zlib.Decompress.copy Return a copy of the decompression object. @@ -1039,6 +1065,33 @@ error: Py_XDECREF(retval); return NULL; } + +/*[clinic input] +zlib.Decompress.__copy__ +[clinic start generated code]*/ + +static PyObject * +zlib_Decompress___copy___impl(compobject *self) +/*[clinic end generated code: output=80bae8bc43498ad4 input=efcb98b5472c13d2]*/ +{ + return zlib_Decompress_copy_impl(self); +} + +/*[clinic input] +zlib.Decompress.__deepcopy__ + + memo: object + / + +[clinic start generated code]*/ + +static PyObject * +zlib_Decompress___deepcopy__(compobject *self, PyObject *memo) +/*[clinic end generated code: output=1f77286ab490124b input=6e99bd0ac4b9cd8b]*/ +{ + return zlib_Decompress_copy_impl(self); +} + #endif /*[clinic input] @@ -1139,6 +1192,8 @@ static PyMethodDef comp_methods[] = ZLIB_COMPRESS_COMPRESS_METHODDEF ZLIB_COMPRESS_FLUSH_METHODDEF ZLIB_COMPRESS_COPY_METHODDEF + ZLIB_COMPRESS___COPY___METHODDEF + ZLIB_COMPRESS___DEEPCOPY___METHODDEF {NULL, NULL} }; @@ -1147,6 +1202,8 @@ static PyMethodDef Decomp_methods[] = ZLIB_DECOMPRESS_DECOMPRESS_METHODDEF ZLIB_DECOMPRESS_FLUSH_METHODDEF ZLIB_DECOMPRESS_COPY_METHODDEF + ZLIB_DECOMPRESS___COPY___METHODDEF + ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF {NULL, NULL} }; |