Skip to content

Commit d3785cc

Browse files
committed
[FIX] server: no build_now on arch_eval for __all__
as __all__ is evaluated at arch step, a follow_ref on it should not try to build arch_eval. It can lead to a borrow error
1 parent 1560cda commit d3785cc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

server/src/core/python_arch_builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ impl PythonArchBuilder {
170170
}
171171
let mut all_name_allowed = true;
172172
let mut name_filter: Vec<OYarn> = vec![];
173-
if let Some(all) = import_result.symbol.borrow().get_content_symbol("__all__", u32::MAX).symbols.first() {
173+
if let Some(all) = import_result.symbol.borrow().get_content_symbol("__all__", u32::MAX).symbols.first().cloned() {
174174
let all_value = Symbol::follow_ref(&EvaluationSymbolPtr::WEAK(EvaluationSymbolWeak::new(
175-
Rc::downgrade(all), None, false
175+
Rc::downgrade(&all), None, false
176176
)), session, &mut None, false, true, None, &mut self.diagnostics);
177177
if let Some(all_value_first) = all_value.get(0) {
178178
if !all_value_first.is_expired_if_weak() {

server/src/core/symbols/symbol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1885,7 +1885,7 @@ impl Symbol {
18851885
continue;
18861886
}
18871887
}
1888-
if sym_rc.borrow().as_variable().evaluations.is_empty() && can_eval_external {
1888+
if sym_rc.borrow().as_variable().evaluations.is_empty() && sym_rc.borrow().name() != "__all__" && can_eval_external {
18891889
//no evaluation? let's check that the file has been evaluated
18901890
let file_symbol = sym_rc.borrow().get_file();
18911891
if let Some(file_symbol) = file_symbol {

0 commit comments

Comments
 (0)