summaryrefslogtreecommitdiffstats
path: root/Modules/zlibmodule.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-06-12 03:33:09 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-06-12 03:33:09 (GMT)
commit6e73aaab474ab9df512e8f24029ed1c57f39c619 (patch)
tree52ce5b5abe343a3b08f92af29ddf7832ddad360d /Modules/zlibmodule.c
parenta6d80faf6c7074ad970a2ba15e825d5343a37ec3 (diff)
downloadcpython-6e73aaab474ab9df512e8f24029ed1c57f39c619.zip
cpython-6e73aaab474ab9df512e8f24029ed1c57f39c619.tar.gz
cpython-6e73aaab474ab9df512e8f24029ed1c57f39c619.tar.bz2
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.
Diffstat (limited to 'Modules/zlibmodule.c')
-rw-r--r--Modules/zlibmodule.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c
index 06b0690..da31e8b 100644
--- a/Modules/zlibmodule.c
+++ b/Modules/zlibmodule.c
@@ -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}
};