From 106311eadffd1be5438555fbc4f8ee2f1ccfcb3b Mon Sep 17 00:00:00 2001 From: Noah <33094578+coolreader18@users.noreply.github.com> Date: Sun, 12 Apr 2020 22:47:47 -0500 Subject: [PATCH] Add stub _json module --- vm/src/stdlib/json.rs | 6 ++++++ vm/src/stdlib/mod.rs | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 vm/src/stdlib/json.rs diff --git a/vm/src/stdlib/json.rs b/vm/src/stdlib/json.rs new file mode 100644 index 000000000..0a1532f9c --- /dev/null +++ b/vm/src/stdlib/json.rs @@ -0,0 +1,6 @@ +use crate::pyobject::PyObjectRef; +use crate::VirtualMachine; + +pub fn make_module(vm: &VirtualMachine) -> PyObjectRef { + py_module!(vm, "_json", {}) +} diff --git a/vm/src/stdlib/mod.rs b/vm/src/stdlib/mod.rs index 0758d6447..33195f2e6 100644 --- a/vm/src/stdlib/mod.rs +++ b/vm/src/stdlib/mod.rs @@ -15,6 +15,7 @@ mod hashlib; mod imp; pub mod io; mod itertools; +mod json; #[cfg(feature = "rustpython-parser")] mod keyword; mod marshal; @@ -71,14 +72,15 @@ pub fn get_module_inits() -> HashMap { let mut modules = hashmap! { "array".to_owned() => Box::new(array::make_module) as StdlibInitFunc, "binascii".to_owned() => Box::new(binascii::make_module), - "dis".to_owned() => Box::new(dis::make_module), "_collections".to_owned() => Box::new(collections::make_module), "_csv".to_owned() => Box::new(csv::make_module), - "_functools".to_owned() => Box::new(functools::make_module), + "dis".to_owned() => Box::new(dis::make_module), "errno".to_owned() => Box::new(errno::make_module), + "_functools".to_owned() => Box::new(functools::make_module), "hashlib".to_owned() => Box::new(hashlib::make_module), "itertools".to_owned() => Box::new(itertools::make_module), "_io".to_owned() => Box::new(io::make_module), + "_json".to_owned() => Box::new(json::make_module), "marshal".to_owned() => Box::new(marshal::make_module), "math".to_owned() => Box::new(math::make_module), "_operator".to_owned() => Box::new(operator::make_module),