fix: display error instead of crash when ERG_PATH is not found

This commit is contained in:
Shunsuke Shibayama 2023-04-27 16:44:06 +09:00
parent c4205c4ddd
commit 219611b813
2 changed files with 22 additions and 17 deletions

View file

@ -466,23 +466,13 @@ const KW_SUPER: &str = "Super";
const KW_MAXSPLIT: &str = "maxsplit";
const KW_SUB: &str = "sub";
#[cfg(not(feature = "no_std"))]
pub fn builtins_path() -> PathBuf {
erg_common::env::erg_pystd_path().join("builtins.d.er")
}
#[cfg(feature = "no_std")]
pub fn builtins_path() -> PathBuf {
PathBuf::from("lib/pystd/builtins.d.er")
}
#[cfg(not(feature = "no_std"))]
pub fn std_decl_path() -> PathBuf {
erg_common::env::erg_std_decl_path()
}
#[cfg(feature = "no_std")]
pub fn std_decl_path() -> PathBuf {
PathBuf::from("lib/std.d")
}
impl Context {
fn register_builtin_decl(