Skip to content

Commit 106311e

Browse files
committed
Add stub _json module
1 parent ad111b0 commit 106311e

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

vm/src/stdlib/json.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
use crate::pyobject::PyObjectRef;
2+
use crate::VirtualMachine;
3+
4+
pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
5+
py_module!(vm, "_json", {})
6+
}

vm/src/stdlib/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ mod hashlib;
1515
mod imp;
1616
pub mod io;
1717
mod itertools;
18+
mod json;
1819
#[cfg(feature = "rustpython-parser")]
1920
mod keyword;
2021
mod marshal;
@@ -71,14 +72,15 @@ pub fn get_module_inits() -> HashMap<String, StdlibInitFunc> {
7172
let mut modules = hashmap! {
7273
"array".to_owned() => Box::new(array::make_module) as StdlibInitFunc,
7374
"binascii".to_owned() => Box::new(binascii::make_module),
74-
"dis".to_owned() => Box::new(dis::make_module),
7575
"_collections".to_owned() => Box::new(collections::make_module),
7676
"_csv".to_owned() => Box::new(csv::make_module),
77-
"_functools".to_owned() => Box::new(functools::make_module),
77+
"dis".to_owned() => Box::new(dis::make_module),
7878
"errno".to_owned() => Box::new(errno::make_module),
79+
"_functools".to_owned() => Box::new(functools::make_module),
7980
"hashlib".to_owned() => Box::new(hashlib::make_module),
8081
"itertools".to_owned() => Box::new(itertools::make_module),
8182
"_io".to_owned() => Box::new(io::make_module),
83+
"_json".to_owned() => Box::new(json::make_module),
8284
"marshal".to_owned() => Box::new(marshal::make_module),
8385
"math".to_owned() => Box::new(math::make_module),
8486
"_operator".to_owned() => Box::new(operator::make_module),

0 commit comments

Comments
 (0)