File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,9 @@ use vm::{builtins::PyStrRef, Interpreter};
44
55fn py_main ( interp : & Interpreter ) -> vm:: PyResult < PyStrRef > {
66 interp. enter ( |vm| {
7+ // Add local library path
78 vm. insert_sys_path ( vm. new_pyobj ( "examples" ) )
8- . expect ( "add path" ) ;
9+ . expect ( "add examples to sys. path failed " ) ;
910 let module = vm. import ( "package_embed" , None , 0 ) ?;
1011 let name_func = module. get_attr ( "context" , vm) ?;
1112 let result = name_func. call ( ( ) , vm) ?;
@@ -15,7 +16,10 @@ fn py_main(interp: &Interpreter) -> vm::PyResult<PyStrRef> {
1516}
1617
1718fn main ( ) -> ExitCode {
18- let interp = vm:: Interpreter :: with_init ( Default :: default ( ) , |vm| {
19+ // Add standard library path
20+ let mut settings = vm:: Settings :: default ( ) ;
21+ settings. path_list . push ( "Lib" . to_owned ( ) ) ;
22+ let interp = vm:: Interpreter :: with_init ( settings, |vm| {
1923 vm. add_native_modules ( rustpython_stdlib:: get_module_inits ( ) ) ;
2024 } ) ;
2125 let result = py_main ( & interp) ;
You can’t perform that action at this time.
0 commit comments