Skip to content

Commit 7ab9a64

Browse files
committed
Remove the serde_json based json module, update tests
1 parent d897660 commit 7ab9a64

File tree

5 files changed

+2
-90
lines changed

5 files changed

+2
-90
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/snippets/json_snippet.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,5 @@ class Dict(dict): pass
182182
assert json.dumps({'a': 'b'}) == json.dumps(Dict({'a': 'b'}))
183183
assert json_dump({'a': 'b'}) == json_dump(Dict({'a': 'b'}))
184184

185-
# big ints should not crash VM
186-
# TODO: test for correct output when actual serialization implemented and doesn’t throw
187-
try:
188-
json.dumps(7**500)
189-
except:
190-
pass
185+
i = 7**500
186+
assert json.dumps(i) == str(i)

vm/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ rustpython-parser = {path = "../parser", optional = true, version = "0.1.1"}
4040
rustpython-compiler = {path = "../compiler", optional = true, version = "0.1.1"}
4141
rustpython-bytecode = { path = "../bytecode", version = "0.1.1"}
4242
serde = { version = "1.0.66", features = ["derive"] }
43-
serde_json = "1.0.26"
4443
byteorder = "1.2.6"
4544
regex = "1"
4645
rustc_version_runtime = "0.1.*"

vm/src/stdlib/json.rs

Lines changed: 0 additions & 80 deletions
This file was deleted.

vm/src/stdlib/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ mod hashlib;
1515
mod imp;
1616
pub mod io;
1717
mod itertools;
18-
mod json;
1918
#[cfg(feature = "rustpython-parser")]
2019
mod keyword;
2120
mod marshal;
@@ -80,7 +79,6 @@ pub fn get_module_inits() -> HashMap<String, StdlibInitFunc> {
8079
"hashlib".to_owned() => Box::new(hashlib::make_module),
8180
"itertools".to_owned() => Box::new(itertools::make_module),
8281
"_io".to_owned() => Box::new(io::make_module),
83-
"json".to_owned() => Box::new(json::make_module),
8482
"marshal".to_owned() => Box::new(marshal::make_module),
8583
"math".to_owned() => Box::new(math::make_module),
8684
"_operator".to_owned() => Box::new(operator::make_module),

0 commit comments

Comments
 (0)