Skip to content

Commit 25a25b7

Browse files
committed
fix pyexpat hang
1 parent 6dbc8f0 commit 25a25b7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/stdlib/src/pyexpat.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ mod _pyexpat {
102102
where
103103
T: IntoFuncArgs,
104104
{
105-
handler.read().call(args, vm).ok();
105+
// Clone the handler while holding the read lock, then release the lock
106+
let handler = handler.read().clone();
107+
handler.call(args, vm).ok();
106108
}
107109

108110
#[pyclass]

0 commit comments

Comments
 (0)