mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Make rustpython -i script.py work like it does in CPython
This commit is contained in:
2 files changed
+8
-6
No files matched your search
+8
-1
@@ -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)?;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in new issue
Block a user