Improved PR based on feedback

This commit is contained in:
Syrus
2019-10-07 23:43:51 -07:00
parent f1ad06d470
commit 32123b56d4
2 changed files with 4 additions and 8 deletions

View File

@@ -321,11 +321,8 @@ fn write_profile(matches: &ArgMatches) -> Result<(), Box<dyn std::error::Error>>
}
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}",

View File

@@ -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"