From 32123b56d4aec454af795f8660ef20b002625c8e Mon Sep 17 00:00:00 2001 From: Syrus Date: Mon, 7 Oct 2019 23:43:51 -0700 Subject: [PATCH] Improved PR based on feedback --- src/main.rs | 10 +++------- wapm.toml | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index cd40e8690e..78f90f3653 100644 --- a/src/main.rs +++ b/src/main.rs @@ -321,11 +321,8 @@ fn write_profile(matches: &ArgMatches) -> Result<(), Box> } fn run_rustpython(vm: &VirtualMachine, matches: &ArgMatches) -> PyResult<()> { - #[cfg(not(target_os = "wasi"))] - import::init_importlib(&vm, true)?; - - #[cfg(target_os = "wasi")] - import::init_importlib(&vm, false)?; + // We only include the standard library bytecode in WASI + import::init_importlib(&vm, cfg!(not(target_os = "wasi")))?; if let Some(paths) = option_env!("BUILDTIME_RUSTPYTHONPATH") { let sys_path = vm.get_attribute(vm.sys_module.clone(), "path")?; @@ -602,11 +599,10 @@ fn run_shell(vm: &VirtualMachine, scope: Scope) -> PyResult<()> { Ok(()) } - #[cfg(target_os = "wasi")] fn run_shell(vm: &VirtualMachine, scope: Scope) -> PyResult<()> { - use std::io::{self, BufRead}; use std::io::prelude::*; + use std::io::{self, BufRead}; println!( "Welcome to the magnificent Rust Python {} interpreter \u{1f631} \u{1f596}", diff --git a/wapm.toml b/wapm.toml index e45248dcd2..6c0575ee86 100644 --- a/wapm.toml +++ b/wapm.toml @@ -1,6 +1,6 @@ [package] name="rustpython" -version="0.0.1" +version="0.0.4" description="A Python-3 (CPython >= 3.5.0) Interpreter written in Rust 🐍 😱 🤘" license-file="LICENSE" readme = "README.md"