mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Patch #1503046, Conditional compilation of zlib.(de)compressobj.copy
copy is only in newer versions of zlib. This should allow zlibmodule to work with older versions like the Tru64 buildbot.
This commit is contained in:
parent
a6d80faf6c
commit
6e73aaab47
6 changed files with 137 additions and 50 deletions
|
@ -653,6 +653,7 @@ PyZlib_flush(compobject *self, PyObject *args)
|
|||
return RetVal;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZLIB_COPY
|
||||
PyDoc_STRVAR(comp_copy__doc__,
|
||||
"copy() -- Return a copy of the compression object.");
|
||||
|
||||
|
@ -754,6 +755,7 @@ error:
|
|||
Py_XDECREF(retval);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
PyDoc_STRVAR(decomp_flush__doc__,
|
||||
"flush( [length] ) -- Return a string containing any remaining\n"
|
||||
|
@ -827,8 +829,10 @@ static PyMethodDef comp_methods[] =
|
|||
comp_compress__doc__},
|
||||
{"flush", (binaryfunc)PyZlib_flush, METH_VARARGS,
|
||||
comp_flush__doc__},
|
||||
#ifdef HAVE_ZLIB_COPY
|
||||
{"copy", (PyCFunction)PyZlib_copy, METH_NOARGS,
|
||||
comp_copy__doc__},
|
||||
#endif
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
@ -838,8 +842,10 @@ static PyMethodDef Decomp_methods[] =
|
|||
decomp_decompress__doc__},
|
||||
{"flush", (binaryfunc)PyZlib_unflush, METH_VARARGS,
|
||||
decomp_flush__doc__},
|
||||
#ifdef HAVE_ZLIB_COPY
|
||||
{"copy", (PyCFunction)PyZlib_uncopy, METH_NOARGS,
|
||||
decomp_copy__doc__},
|
||||
#endif
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue