mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 18:58:30 +00:00
Update config.rs
This commit is contained in:
parent
e1ff65534f
commit
7a25ba076e
1 changed files with 15 additions and 14 deletions
|
@ -552,20 +552,21 @@ impl Input {
|
|||
return Ok(path);
|
||||
}
|
||||
}
|
||||
if EXPERIMENTAL_MODE {
|
||||
for sys_path in self.sys_path()? {
|
||||
let mut dir = sys_path;
|
||||
dir.push(path);
|
||||
dir.set_extension("py");
|
||||
if dir.exists() {
|
||||
return Ok(normalize_path(dir));
|
||||
}
|
||||
dir.pop();
|
||||
dir.push(path);
|
||||
dir.push("__init__.py");
|
||||
if dir.exists() {
|
||||
return Ok(normalize_path(dir));
|
||||
}
|
||||
for sys_path in self.sys_path()? {
|
||||
let mut dir = sys_path;
|
||||
dir.push(path);
|
||||
dir.set_extension("py");
|
||||
if dir.exists() {
|
||||
return Ok(normalize_path(dir));
|
||||
}
|
||||
dir.pop();
|
||||
dir.push(path);
|
||||
dir.push("__init__.py");
|
||||
if dir.exists() {
|
||||
return Ok(normalize_path(dir));
|
||||
}
|
||||
if !EXPERIMENTAL_MODE {
|
||||
break;
|
||||
}
|
||||
}
|
||||
Err(std::io::Error::new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue