summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/bz2module.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/bz2module.c b/Modules/bz2module.c
index 82d35ae..c75011d 100644
--- a/Modules/bz2module.c
+++ b/Modules/bz2module.c
@@ -1503,6 +1503,9 @@ BZ2Comp_compress(BZ2CompObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s#", &data, &datasize))
return NULL;
+ if (datasize == 0)
+ return PyString_FromString("");
+
ACQUIRE_LOCK(self);
if (!self->running) {
PyErr_SetString(PyExc_ValueError,