Skip to content

Commit 5a5b721

Browse files
authored
Fix misused PyTypeError (#6412)
1 parent df3a0b2 commit 5a5b721

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/stdlib/src/csv.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mod _csv {
55
use crate::common::lock::PyMutex;
66
use crate::vm::{
77
AsObject, Py, PyObjectRef, PyPayload, PyRef, PyResult, TryFromObject, VirtualMachine,
8-
builtins::{PyBaseExceptionRef, PyInt, PyNone, PyStr, PyType, PyTypeError, PyTypeRef},
8+
builtins::{PyBaseExceptionRef, PyInt, PyNone, PyStr, PyType, PyTypeRef},
99
function::{ArgIterable, ArgumentError, FromArgs, FuncArgs, OptionalArg},
1010
protocol::{PyIter, PyIterReturn},
1111
raise_if_stop,
@@ -442,16 +442,16 @@ mod _csv {
442442
}
443443
}
444444
impl TryFrom<isize> for QuoteStyle {
445-
type Error = PyTypeError;
446-
fn try_from(num: isize) -> Result<Self, PyTypeError> {
445+
type Error = ();
446+
fn try_from(num: isize) -> Result<Self, Self::Error> {
447447
match num {
448448
0 => Ok(Self::Minimal),
449449
1 => Ok(Self::All),
450450
2 => Ok(Self::Nonnumeric),
451451
3 => Ok(Self::None),
452452
4 => Ok(Self::Strings),
453453
5 => Ok(Self::Notnull),
454-
_ => Err(PyTypeError {}),
454+
_ => Err(()),
455455
}
456456
}
457457
}

0 commit comments

Comments
 (0)