diff --git a/vm/src/obj/objfunction.rs b/vm/src/obj/objfunction.rs index 4f5af1bec2..7386772ea0 100644 --- a/vm/src/obj/objfunction.rs +++ b/vm/src/obj/objfunction.rs @@ -11,7 +11,7 @@ use crate::obj::objcoroutine::PyCoroutine; use crate::obj::objgenerator::PyGenerator; use crate::pyobject::{ IdProtocol, ItemProtocol, PyClassImpl, PyContext, PyObjectRef, PyRef, PyResult, PyValue, - TypeProtocol, + ThreadSafe, TypeProtocol, }; use crate::scope::Scope; use crate::slots::{SlotCall, SlotDescriptor}; @@ -28,6 +28,7 @@ pub struct PyFunction { defaults: Option, kw_only_defaults: Option, } +impl ThreadSafe for PyFunction {} impl SlotDescriptor for PyFunction { fn descr_get( @@ -293,6 +294,8 @@ pub struct PyBoundMethod { pub function: PyObjectRef, } +impl ThreadSafe for PyBoundMethod {} + impl SlotCall for PyBoundMethod { fn call(&self, args: PyFuncArgs, vm: &VirtualMachine) -> PyResult { let args = args.insert(self.object.clone());