mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 18:29:00 +00:00
Update pathutil.rs
This commit is contained in:
parent
c279472ad8
commit
d972af35d0
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue