mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 18:29:00 +00:00
fix: path resolution bug
This commit is contained in:
parent
1ec95a6ff9
commit
bfc403af09
4 changed files with 21 additions and 13 deletions
|
@ -1884,7 +1884,7 @@ impl Context {
|
|||
let mod_ctx = ModuleContext::new(self.clone(), dict! {});
|
||||
let mut builder = HIRBuilder::new_with_ctx(mod_ctx);
|
||||
let src = Input::file(path.to_path_buf()).read();
|
||||
let mode = if path.ends_with(".d.er") {
|
||||
let mode = if path.to_string_lossy().ends_with(".d.er") {
|
||||
"declare"
|
||||
} else {
|
||||
"exec"
|
||||
|
@ -1895,7 +1895,7 @@ impl Context {
|
|||
Err(art) => art.object,
|
||||
};
|
||||
let ctx = builder.pop_mod_ctx().unwrap();
|
||||
let cache = if path.ends_with("d.er") {
|
||||
let cache = if path.to_string_lossy().ends_with("d.er") {
|
||||
&self.shared().py_mod_cache
|
||||
} else {
|
||||
&self.shared().mod_cache
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue