Skip to content

Commit

Permalink
fix: path resolution bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Nov 30, 2024
1 parent 24dd989 commit 353b403
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions crates/erg_common/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ impl Input {
dir.push(path);
dir.set_extension("py");
let path = dir.canonicalize().or_else(|_| {
dir.pop();
let mut dir = self.dir();
dir.push(path);
dir.push("__init__.py"); // {path}/__init__.er
dir.canonicalize()
Expand Down Expand Up @@ -499,7 +499,7 @@ impl Input {
VFS.cache_path(self.clone(), path.to_path_buf(), Some(resolved.clone()));
return Ok(resolved);
}
dir.pop();
let mut dir = sys_path.clone();
dir.push(path);
dir.push("__init__.py");
if dir.exists() {
Expand All @@ -520,7 +520,7 @@ impl Input {
VFS.cache_path(self.clone(), path.to_path_buf(), Some(resolved.clone()));
return Ok(resolved);
}
dir.pop();
let mut dir = pkgs_path.clone();
dir.push(path);
dir.push("__init__.py");
if dir.exists() {
Expand Down
4 changes: 2 additions & 2 deletions crates/erg_compiler/context/initialize/classes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,9 +1024,9 @@ impl Context {
FUNC_SPLIT,
fn_met(
Str,
vec![kw(KW_SEP, Str)],
vec![],
None,
vec![kw(KW_MAXSPLIT, Nat)],
vec![kw(KW_SEP, Str), kw(KW_MAXSPLIT, Nat)],
None,
out_unknown_len_list_t(Str),
),
Expand Down

0 comments on commit 353b403

Please sign in to comment.