Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Revert "Split out common compression routines into separate file (#5728
…)"

This reverts commit 9c88475.
  • Loading branch information
youknowone committed May 7, 2025
commit 48b08a2b7f1eaecf11a6f7bd126f578e10b9a7d1
8 changes: 4 additions & 4 deletions stdlib/src/compression/bz2.rs → stdlib/src/bz2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ pub(crate) use _bz2::make_module;

#[pymodule]
mod _bz2 {
use super::super::{
DecompressArgs, DecompressError, DecompressState, DecompressStatus, Decompressor,
};
use crate::common::lock::PyMutex;
use crate::vm::{
VirtualMachine,
Expand All @@ -15,6 +12,9 @@ mod _bz2 {
object::{PyPayload, PyResult},
types::Constructor,
};
use crate::zlib::{
DecompressArgs, DecompressError, DecompressState, DecompressStatus, Decompressor,
};
use bzip2::{Decompress, Status, write::BzEncoder};
use rustpython_vm::convert::ToPyException;
use std::{fmt, io::Write};
Expand Down Expand Up @@ -74,7 +74,7 @@ mod _bz2 {
impl BZ2Decompressor {
#[pymethod]
fn decompress(&self, args: DecompressArgs, vm: &VirtualMachine) -> PyResult<Vec<u8>> {
let max_length = args.max_length_negative_is_none();
let max_length = args.max_length();
let data = &*args.data();

let mut state = self.state.lock();
Expand Down
268 changes: 0 additions & 268 deletions stdlib/src/compression/generic.rs

This file was deleted.

5 changes: 0 additions & 5 deletions stdlib/src/compression/mod.rs

This file was deleted.

7 changes: 4 additions & 3 deletions stdlib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ mod sha256;
mod sha3;
mod sha512;

mod compression;
mod json;
#[cfg(not(any(target_os = "ios", target_os = "android", target_arch = "wasm32")))]
mod locale;
Expand All @@ -38,11 +37,13 @@ mod statistics;
mod suggestions;
// TODO: maybe make this an extension module, if we ever get those
// mod re;
mod bz2;
#[cfg(not(target_arch = "wasm32"))]
pub mod socket;
#[cfg(all(unix, not(target_os = "redox")))]
mod syslog;
mod unicodedata;
mod zlib;

mod faulthandler;
#[cfg(any(unix, target_os = "wasi"))]
Expand Down Expand Up @@ -111,7 +112,7 @@ pub fn get_module_inits() -> impl Iterator<Item = (Cow<'static, str>, StdlibInit
"array" => array::make_module,
"binascii" => binascii::make_module,
"_bisect" => bisect::make_module,
"_bz2" => compression::bz2::make_module,
"_bz2" => bz2::make_module,
"cmath" => cmath::make_module,
"_contextvars" => contextvars::make_module,
"_csv" => csv::make_module,
Expand All @@ -132,7 +133,7 @@ pub fn get_module_inits() -> impl Iterator<Item = (Cow<'static, str>, StdlibInit
"_statistics" => statistics::make_module,
"_struct" => pystruct::make_module,
"unicodedata" => unicodedata::make_module,
"zlib" => compression::zlib::make_module,
"zlib" => zlib::make_module,
"_statistics" => statistics::make_module,
"_suggestions" => suggestions::make_module,
// crate::vm::sysmodule::sysconfigdata_name() => sysconfigdata::make_module,
Expand Down
Loading