Mark PyStruct as ThreadSafe

This commit is contained in:
Aviv Palivoda
2020-05-15 09:25:47 +03:00
parent 89381258dd
commit 4ca4709d5a

View File

@@ -27,7 +27,7 @@ mod _struct {
objtuple::PyTuple, objtype::PyClassRef,
};
use crate::pyobject::{
Either, PyClassImpl, PyObjectRef, PyRef, PyResult, PyValue, TryFromObject,
Either, PyClassImpl, PyObjectRef, PyRef, PyResult, PyValue, ThreadSafe, TryFromObject,
};
use crate::VirtualMachine;
@@ -679,6 +679,8 @@ mod _struct {
fmt_str: PyStringRef,
}
impl ThreadSafe for PyStruct {}
impl PyValue for PyStruct {
fn class(vm: &VirtualMachine) -> PyClassRef {
vm.class("_struct", "Struct")