From fd4b83d5e9106702404d8ccb2beaa9fc3085f344 Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Fri, 12 Dec 2025 16:35:39 +0900 Subject: [PATCH] Fix misused PyTypeError --- crates/stdlib/src/csv.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/stdlib/src/csv.rs b/crates/stdlib/src/csv.rs index 39ca70640d..3c7cc2ff80 100644 --- a/crates/stdlib/src/csv.rs +++ b/crates/stdlib/src/csv.rs @@ -5,7 +5,7 @@ mod _csv { use crate::common::lock::PyMutex; use crate::vm::{ AsObject, Py, PyObjectRef, PyPayload, PyRef, PyResult, TryFromObject, VirtualMachine, - builtins::{PyBaseExceptionRef, PyInt, PyNone, PyStr, PyType, PyTypeError, PyTypeRef}, + builtins::{PyBaseExceptionRef, PyInt, PyNone, PyStr, PyType, PyTypeRef}, function::{ArgIterable, ArgumentError, FromArgs, FuncArgs, OptionalArg}, protocol::{PyIter, PyIterReturn}, raise_if_stop, @@ -442,8 +442,8 @@ mod _csv { } } impl TryFrom for QuoteStyle { - type Error = PyTypeError; - fn try_from(num: isize) -> Result { + type Error = (); + fn try_from(num: isize) -> Result { match num { 0 => Ok(Self::Minimal), 1 => Ok(Self::All), @@ -451,7 +451,7 @@ mod _csv { 3 => Ok(Self::None), 4 => Ok(Self::Strings), 5 => Ok(Self::Notnull), - _ => Err(PyTypeError {}), + _ => Err(()), } } }