Skip to content

Commit e8b9b4b

Browse files
committed
move path "" to vm.initialize
1 parent d32cd53 commit e8b9b4b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,6 @@ fn add_stdlib(vm: &mut VirtualMachine) {
261261
#[allow(clippy::needless_collect)] // false positive
262262
let path_list: Vec<_> = state.settings.path_list.drain(..).collect();
263263

264-
// add the current directory to sys.path
265-
state.settings.path_list.push("".to_owned());
266-
267264
// BUILDTIME_RUSTPYTHONPATH should be set when distributing
268265
if let Some(paths) = option_env!("BUILDTIME_RUSTPYTHONPATH") {
269266
state

vm/src/vm/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ impl VirtualMachine {
227227
panic!("Double Initialize Error");
228228
}
229229

230+
// add the current directory to sys.path
231+
self.state_mut().settings.path_list.insert(0, "".to_owned());
232+
230233
stdlib::builtins::make_module(self, self.builtins.clone().into());
231234
stdlib::sys::init_module(self, self.sys_module.as_ref(), self.builtins.as_ref());
232235

0 commit comments

Comments
 (0)