Skip to content

Commit 9f83dc4

Browse files
committed
fix
1 parent 233e7de commit 9f83dc4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

crates/vm/src/stdlib/thread.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ pub(crate) mod _thread {
77
use crate::{
88
AsObject, Py, PyPayload, PyRef, PyResult, VirtualMachine,
99
builtins::{PyDictRef, PyStr, PyTupleRef, PyType, PyTypeRef},
10-
convert::ToPyException,
1110
function::{ArgCallable, Either, FuncArgs, KwArgs, OptionalArg, PySetterValue},
1211
types::{Constructor, GetAttr, Representable, SetAttr},
1312
};
@@ -373,7 +372,7 @@ pub(crate) mod _thread {
373372
vm.state.thread_count.fetch_add(1);
374373
thread_to_id(&handle)
375374
})
376-
.map_err(|err| err.to_pyexception(vm))
375+
.map_err(|err| vm.new_runtime_error(format!("can't start new thread: {err}")))
377376
}
378377

379378
fn run_thread(func: ArgCallable, args: FuncArgs, vm: &VirtualMachine) {
@@ -1117,7 +1116,7 @@ pub(crate) mod _thread {
11171116
}
11181117
}
11191118
}))
1120-
.map_err(|err| err.to_pyexception(vm))?;
1119+
.map_err(|err| vm.new_runtime_error(format!("can't start new thread: {err}")))?;
11211120

11221121
vm.state.thread_count.fetch_add(1);
11231122

0 commit comments

Comments
 (0)