(
name: PyObjectRef,
mut _rest: FuncArgs,
vm: &VirtualMachine,
)
| 310 | |
| 311 | #[pyfunction] |
| 312 | fn unregister_dialect( |
| 313 | name: PyObjectRef, |
| 314 | mut _rest: FuncArgs, |
| 315 | vm: &VirtualMachine, |
| 316 | ) -> PyResult<()> { |
| 317 | let name = name.downcast::<PyStr>().map_err(|obj| { |
| 318 | new_csv_error( |
| 319 | vm, |
| 320 | format!("argument 0 must be a string, not '{}'", obj.class()), |
| 321 | ) |
| 322 | })?; |
| 323 | let name: PyUtf8StrRef = name.try_into_utf8(vm)?; |
| 324 | let mut g = GLOBAL_HASHMAP.lock(); |
| 325 | if let Some(_removed) = g.remove(name.as_str()) { |
| 326 | return Ok(()); |
| 327 | } |
| 328 | Err(new_csv_error(vm, "unknown dialect")) |
| 329 | } |
| 330 | |
| 331 | #[pyfunction] |
| 332 | fn list_dialects( |
nothing calls this directly
no test coverage detected