Skip to content

Commit

Permalink
Update pathutil.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Mar 12, 2024
1 parent c279472 commit d972af3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/erg_common/pathutil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,12 @@ pub fn mod_name(path: &Path) -> Str {
for parent in path.components().rev().skip(1) {
let parent = parent.as_os_str().to_string_lossy();
if parent.ends_with(".d") {
name = parent.trim_end_matches(".d").to_string() + "." + &name;
let p = parent.trim_end_matches(".d").to_string();
if name == "__init__" {
name = p;
} else {
name = p + "." + &name;
}
} else {
break;
}
Expand Down

0 comments on commit d972af3

Please sign in to comment.