Index: zlibmodule.c =================================================================== --- zlibmodule.c (revision 65475) +++ zlibmodule.c (working copy) @@ -174,7 +174,7 @@ err=deflateEnd(&zst); if (err == Z_OK) - ReturnVal = PyByteArray_FromStringAndSize((char *)output, + ReturnVal = PyBytes_FromStringAndSize((char *)output, zst.total_out); else zlib_error(zst, err, "while finishing compression"); @@ -211,12 +211,12 @@ zst.avail_in = length; zst.avail_out = r_strlen; - if (!(result_str = PyByteArray_FromStringAndSize(NULL, r_strlen))) - return NULL; + if (!(result_str = PyBytes_FromStringAndSize(NULL, r_strlen))) + return NULL; zst.zalloc = (alloc_func)NULL; zst.zfree = (free_func)Z_NULL; - zst.next_out = (Byte *)PyByteArray_AS_STRING(result_str); + zst.next_out = (Byte *)PyBytes_AS_STRING(result_str); zst.next_in = (Byte *)input; err = inflateInit2(&zst, wsize); @@ -256,12 +256,12 @@ /* fall through */ case(Z_OK): /* need more memory */ - if (PyByteArray_Resize(result_str, r_strlen << 1) < 0) { + if (_PyBytes_Resize(&result_str, r_strlen << 1) < 0) { inflateEnd(&zst); goto error; } zst.next_out = - (unsigned char *)PyByteArray_AS_STRING(result_str) + r_strlen; + (unsigned char *)PyBytes_AS_STRING(result_str) + r_strlen; zst.avail_out = r_strlen; r_strlen = r_strlen << 1; break; @@ -278,7 +278,7 @@ goto error; } - if (PyByteArray_Resize(result_str, zst.total_out) < 0) + if (_PyBytes_Resize(&result_str, zst.total_out) < 0) goto error; return result_str;