Skip to content

Commit cc2e97c

Browse files
committed
Mark PyPattern, PyMatch as ThreadSafe
1 parent 0cea276 commit cc2e97c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vm/src/stdlib/re.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::function::{Args, OptionalArg};
1313
use crate::obj::objint::{PyInt, PyIntRef};
1414
use crate::obj::objstr::{PyString, PyStringRef};
1515
use crate::obj::objtype::PyClassRef;
16-
use crate::pyobject::{PyClassImpl, PyObjectRef, PyResult, PyValue, TryFromObject};
16+
use crate::pyobject::{PyClassImpl, PyObjectRef, PyResult, PyValue, ThreadSafe, TryFromObject};
1717
use crate::vm::VirtualMachine;
1818

1919
#[pyclass(name = "Pattern")]
@@ -23,6 +23,8 @@ struct PyPattern {
2323
pattern: String,
2424
}
2525

26+
impl ThreadSafe for PyPattern {}
27+
2628
const IGNORECASE: usize = 2;
2729
const LOCALE: usize = 4;
2830
const MULTILINE: usize = 8;
@@ -75,6 +77,8 @@ struct PyMatch {
7577
captures: Vec<Option<(usize, usize)>>,
7678
}
7779

80+
impl ThreadSafe for PyMatch {}
81+
7882
impl fmt::Debug for PyMatch {
7983
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
8084
write!(f, "Match()")

0 commit comments

Comments
 (0)