Skip to content

Commit b7d8bd6

Browse files
committed
Mark PyGenerator as ThreadSafe
1 parent 58b9603 commit b7d8bd6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

vm/src/obj/objgenerator.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use super::objcoroinner::{Coro, Variant};
77
use super::objtype::PyClassRef;
88
use crate::frame::FrameRef;
99
use crate::function::OptionalArg;
10-
use crate::pyobject::{PyClassImpl, PyContext, PyObjectRef, PyRef, PyResult, PyValue};
10+
use crate::pyobject::{PyClassImpl, PyContext, PyObjectRef, PyRef, PyResult, PyValue, ThreadSafe};
1111
use crate::vm::VirtualMachine;
1212

1313
pub type PyGeneratorRef = PyRef<PyGenerator>;
@@ -18,6 +18,8 @@ pub struct PyGenerator {
1818
inner: Coro,
1919
}
2020

21+
impl ThreadSafe for PyGenerator {}
22+
2123
impl PyValue for PyGenerator {
2224
fn class(vm: &VirtualMachine) -> PyClassRef {
2325
vm.ctx.generator_type()

0 commit comments

Comments
 (0)