@@ -4470,20 +4470,16 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
4470
4470
ASR::symbol_t *t = nullptr ; // current_scope->parent->resolve_symbol(msym);
4471
4471
if (!t) {
4472
4472
std::string rl_path = get_runtime_library_dir ();
4473
- SymbolTable *st = current_scope;
4474
4473
std::vector<std::string> paths;
4475
4474
for (auto &path:import_paths) {
4476
4475
paths.push_back (path);
4477
4476
}
4478
4477
paths.push_back (rl_path);
4479
4478
paths.push_back (parent_dir);
4480
4479
4481
- if (!main_module) {
4482
- st = st->parent ;
4483
- }
4484
4480
bool lpython, enum_py, copy, sympy;
4485
4481
set_module_symbol (msym, paths);
4486
- t = (ASR::symbol_t *)(load_module (al, st ,
4482
+ t = (ASR::symbol_t *)(load_module (al, global_scope ,
4487
4483
msym, x.base .base .loc , diag, lm, false , paths, lpython, enum_py, copy, sympy,
4488
4484
[&](const std::string &msg, const Location &loc) { throw SemanticError (msg, loc); },
4489
4485
allow_implicit_casting));
@@ -4547,18 +4543,14 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
4547
4543
}
4548
4544
paths.push_back (rl_path);
4549
4545
paths.push_back (parent_dir);
4550
- SymbolTable *st = current_scope;
4551
4546
std::vector<std::string> mods;
4552
4547
for (size_t i=0 ; i<x.n_names ; i++) {
4553
4548
mods.push_back (x.m_names [i].m_name );
4554
4549
}
4555
- if (!main_module) {
4556
- st = st->parent ;
4557
- }
4558
4550
for (auto &mod_sym : mods) {
4559
4551
bool lpython, enum_py, copy, sympy;
4560
4552
set_module_symbol (mod_sym, paths);
4561
- t = (ASR::symbol_t *)(load_module (al, st ,
4553
+ t = (ASR::symbol_t *)(load_module (al, global_scope ,
4562
4554
mod_sym, x.base .base .loc , diag, lm, false , paths, lpython, enum_py, copy, sympy,
4563
4555
[&](const std::string &msg, const Location &loc) { throw SemanticError (msg, loc); },
4564
4556
allow_implicit_casting));
0 commit comments