This is an automated email from the ASF dual-hosted git repository. xuanwo pushed a commit to branch refactor-python in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
commit c70f598aef62e69da39c5c6949b0585d3a1f2ea0 Author: Xuanwo <[email protected]> AuthorDate: Fri Nov 3 13:49:28 2023 +0800 remove submodule Signed-off-by: Xuanwo <[email protected]> --- bindings/python/src/layers.rs | 7 ------- bindings/python/src/lib.rs | 5 ++++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/bindings/python/src/layers.rs b/bindings/python/src/layers.rs index c3c9a8cc9..d270c6be4 100644 --- a/bindings/python/src/layers.rs +++ b/bindings/python/src/layers.rs @@ -79,10 +79,3 @@ impl RetryLayer { Ok(class) } } - -pub fn create_submodule(py: Python) -> PyResult<&PyModule> { - let submod = PyModule::new(py, "layers")?; - submod.add_class::<Layer>()?; - submod.add_class::<RetryLayer>()?; - Ok(submod) -} diff --git a/bindings/python/src/lib.rs b/bindings/python/src/lib.rs index cacbadc9c..c2e293fd7 100644 --- a/bindings/python/src/lib.rs +++ b/bindings/python/src/lib.rs @@ -583,7 +583,10 @@ fn _opendal(py: Python, m: &PyModule) -> PyResult<()> { m.add_class::<capability::Capability>()?; m.add("Error", py.get_type::<Error>())?; - let layers_module = layers::create_submodule(py)?; + // Layer module + let layers_module = PyModule::new(py, "layers")?; + layers_module.add_class::<layers::Layer>()?; + layers_module.add_class::<layers::RetryLayer>()?; m.add_submodule(layers_module)?; py.import("sys")? .getattr("modules")?
