From a57f38b07f4d8e2728ed0cd42e73b2d232730545 Mon Sep 17 00:00:00 2001 From: Aviv Palivoda Date: Fri, 7 Jun 2019 19:26:59 +0300 Subject: [PATCH] Rename builtin io to _io --- Lib/io.py | 1 + vm/src/stdlib/io.rs | 2 +- vm/src/stdlib/mod.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 Lib/io.py diff --git a/Lib/io.py b/Lib/io.py new file mode 100644 index 000000000..5536a308c --- /dev/null +++ b/Lib/io.py @@ -0,0 +1 @@ +from _io import * diff --git a/vm/src/stdlib/io.rs b/vm/src/stdlib/io.rs index da8bedf53..2dafc7137 100644 --- a/vm/src/stdlib/io.rs +++ b/vm/src/stdlib/io.rs @@ -471,7 +471,7 @@ pub fn make_module(vm: &VirtualMachine) -> PyObjectRef { "getvalue" => ctx.new_rustfunc(bytes_io_getvalue) }); - py_module!(vm, "io", { + py_module!(vm, "_io", { "open" => ctx.new_rustfunc(io_open), "IOBase" => io_base, "RawIOBase" => raw_io_base, diff --git a/vm/src/stdlib/mod.rs b/vm/src/stdlib/mod.rs index 7c72a1b61..75e554cd6 100644 --- a/vm/src/stdlib/mod.rs +++ b/vm/src/stdlib/mod.rs @@ -61,7 +61,7 @@ pub fn get_module_inits() -> HashMap { // disable some modules on WASM #[cfg(not(target_arch = "wasm32"))] { - modules.insert("io".to_string(), Box::new(io::make_module)); + modules.insert("_io".to_string(), Box::new(io::make_module)); modules.insert("_os".to_string(), Box::new(os::make_module)); modules.insert("socket".to_string(), Box::new(socket::make_module)); }