Skip to content

Commit 46c322d

Browse files
authored
fix: imported files can use stdlib (#1264)
Signed-off-by: Louis Mandel <[email protected]>
1 parent ccef224 commit 46c322d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pdl/pdl_interpreter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2427,9 +2427,10 @@ def process_import(
24272427
prog, new_loc = parse_str(prog_str, file_name=str(file))
24282428
cache = state.imported.get(prog_str)
24292429
if cache is None:
2430+
import_scope = empty_scope | {"stdlib": scope["stdlib"]}
24302431
_, _, new_scope, trace = process_block(
24312432
state.with_yield_background(False).with_yield_result(False),
2432-
empty_scope,
2433+
import_scope,
24332434
prog.root,
24342435
new_loc,
24352436
)

0 commit comments

Comments
 (0)