summaryrefslogtreecommitdiffstats
path: root/Modules/bz2module.c
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2013-01-02 22:02:00 (GMT)
committerNadeem Vawda <nadeem.vawda@gmail.com>2013-01-02 22:02:00 (GMT)
commit638fb9bbedd84975512554194a5a22b9e2c0637c (patch)
treee7bd8731cf16401f9042c945a8d5fed6bb78a9b4 /Modules/bz2module.c
parentd581fff6f009812ff399b387a775218e0ddaaac3 (diff)
downloadcpython-638fb9bbedd84975512554194a5a22b9e2c0637c.zip
cpython-638fb9bbedd84975512554194a5a22b9e2c0637c.tar.gz
cpython-638fb9bbedd84975512554194a5a22b9e2c0637c.tar.bz2
Issue #16828: Fix error incorrectly raised by bz2.compress('').
Patch by Martin Packman.
Diffstat (limited to 'Modules/bz2module.c')
-rw-r--r--Modules/bz2module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/bz2module.c b/Modules/bz2module.c
index 4795965..2e99df9 100644
--- a/Modules/bz2module.c
+++ b/Modules/bz2module.c
@@ -1979,7 +1979,7 @@ bz2_compress(PyObject *self, PyObject *args, PyObject *kwargs)
return NULL;
}
- action = BZ_RUN;
+ action = input_left > 0 ? BZ_RUN : BZ_FINISH;
for (;;) {
char *saved_next_out;