rust/hg-pyo3/src/exceptions.rs
changeset 52784 5e3e8876fd9e
parent 52782 827889802d11
child 52786 4e34e8fd46d4
--- a/rust/hg-pyo3/src/exceptions.rs	Sun Dec 22 20:26:57 2024 +0100
+++ b/rust/hg-pyo3/src/exceptions.rs	Wed Dec 25 15:38:18 2024 +0100
@@ -42,10 +42,10 @@
     PyRuntimeError::new_err(format!("In Rust PyO3 bindings: {e}"))
 }
 
-/// Submodule to hold Mercurial errors defined on the Python side
-///
-/// This is better for clarity, as many hg-core errors have the same names
-/// as their Python world counterparts
+pub fn map_try_lock_error<T>(e: std::sync::TryLockError<T>) -> PyErr {
+    PyRuntimeError::new_err(format!("In Rust PyO3 bindings: {e}"))
+}
+
 pub mod mercurial_py_errors {
     pyo3::import_exception!(mercurial.error, RevlogError);
 }