Make rustpython -i script.py work like it does in CPython

This commit is contained in:
Noah committed 2020-03-27 15:24:08 -05:00
1 parent 12c57ce135
commit 126f41e003
2 files changed
+8 -6

No files matched your search

+8 -1
View File
@@ -368,8 +368,15 @@ fn run_rustpython(vm: &VirtualMachine, matches: &ArgMatches) -> PyResult<()> {
} else if let Some(module) = matches.value_of("m") {
run_module(&vm, module)?;
} else if let Some(filename) = matches.value_of("script") {
run_script(&vm, scope, filename)?
run_script(&vm, scope.clone(), filename)?;
if matches.is_present("inspect") {
shell::run_shell(&vm, scope)?;
}
} else {
println!(
"Welcome to the magnificent Rust Python {} interpreter \u{1f631} \u{1f596}",
crate_version!()
);
shell::run_shell(&vm, scope)?;
}
-5
View File
@@ -41,11 +41,6 @@ fn shell_exec(vm: &VirtualMachine, source: &str, scope: Scope) -> ShellExecResul
}
pub fn run_shell(vm: &VirtualMachine, scope: Scope) -> PyResult<()> {
println!(
"Welcome to the magnificent Rust Python {} interpreter \u{1f631} \u{1f596}",
crate_version!()
);
let mut repl = Readline::new(helper::ShellHelper::new(vm, scope.clone()));
let mut full_input = String::new();