FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Make the REPL handle line continuation better by coolreader18 · Pull Request #711 · RustPython/RustPython · GitHub

Repository navigation

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .rs  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Prev Previous commit
Next Next commit
Use vm.get_attribute
  • Loading branch information
coolreader18 committed Mar 22, 2019
commit 36ff4e37d360fe8dad35409b25e65aef34fe53d2
14 changes: 4 additions & 10 deletions src/main.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,8 @@ extern crate rustyline;
use clap::{App, Arg};
use rustpython_parser::error::ParseError;
use rustpython_vm::{
compile,
error::CompileError,
frame::Scope,
import,
obj::objstr,
print_exception,
pyobject::{AttributeProtocol, PyResult},
util, VirtualMachine,
compile, error::CompileError, frame::Scope, import, obj::objstr, print_exception,
pyobject::PyResult, util, VirtualMachine,
};
use rustyline::{error::ReadlineError, Editor};
use std::path::{Path, PathBuf};
Expand Down Expand Up @@ -160,8 +154,8 @@ fn get_history_path() -> PathBuf {
}

fn get_prompt(vm: &mut VirtualMachine, prompt_name: &str) -> String {
vm.sys_module
.get_attr(prompt_name)
vm.get_attribute(vm.sys_module.clone(), prompt_name)
.ok()
.as_ref()
.map(objstr::get_value)
.unwrap_or_else(String::new)
Expand Down

Back | FazBrowse Home | New Git URL