Mark PyPattern, PyMatch as ThreadSafe

This commit is contained in:
Aviv Palivoda committed 2020-05-15 10:34:23 +03:00
1 parent 0cea276cb1
commit cc2e97c436
1 file changed
+5 -1
+5 -1
View File
@@ -13,7 +13,7 @@ use crate::function::{Args, OptionalArg};
use crate::obj::objint::{PyInt, PyIntRef};
use crate::obj::objstr::{PyString, PyStringRef};
use crate::obj::objtype::PyClassRef;
use crate::pyobject::{PyClassImpl, PyObjectRef, PyResult, PyValue, TryFromObject};
use crate::pyobject::{PyClassImpl, PyObjectRef, PyResult, PyValue, ThreadSafe, TryFromObject};
use crate::vm::VirtualMachine;
#[pyclass(name = "Pattern")]
@@ -23,6 +23,8 @@ struct PyPattern {
pattern: String,
}
impl ThreadSafe for PyPattern {}
const IGNORECASE: usize = 2;
const LOCALE: usize = 4;
const MULTILINE: usize = 8;
@@ -75,6 +77,8 @@ struct PyMatch {
captures: Vec<Option<(usize, usize)>>,
}
impl ThreadSafe for PyMatch {}
impl fmt::Debug for PyMatch {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Match()")