Skip to content

Commit a128e0b

Browse files
committed
fill PyTypeInfo::NAME with a Pythonic value
1 parent 417a5c5 commit a128e0b

32 files changed

+230
-74
lines changed

newsfragments/5352.changed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fill `PyTypeInfo::NAME` with Pythonic values (e.g. BasedException) instead of C ones (e.g. PyBasedException)

src/conversions/jiff.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -533,31 +533,31 @@ mod tests {
533533
let none = py.None().into_bound(py);
534534
assert_eq!(
535535
none.extract::<Span>().unwrap_err().to_string(),
536-
"TypeError: 'NoneType' object cannot be converted to 'PyDelta'"
536+
"TypeError: 'NoneType' object cannot be converted to 'timedelta'"
537537
);
538538
assert_eq!(
539539
none.extract::<Offset>().unwrap_err().to_string(),
540-
"TypeError: 'NoneType' object cannot be converted to 'PyTzInfo'"
540+
"TypeError: 'NoneType' object cannot be converted to 'tzinfo'"
541541
);
542542
assert_eq!(
543543
none.extract::<TimeZone>().unwrap_err().to_string(),
544-
"TypeError: 'NoneType' object cannot be converted to 'PyTzInfo'"
544+
"TypeError: 'NoneType' object cannot be converted to 'tzinfo'"
545545
);
546546
assert_eq!(
547547
none.extract::<Time>().unwrap_err().to_string(),
548-
"TypeError: 'NoneType' object cannot be converted to 'PyTime'"
548+
"TypeError: 'NoneType' object cannot be converted to 'time'"
549549
);
550550
assert_eq!(
551551
none.extract::<Date>().unwrap_err().to_string(),
552-
"TypeError: 'NoneType' object cannot be converted to 'PyDate'"
552+
"TypeError: 'NoneType' object cannot be converted to 'date'"
553553
);
554554
assert_eq!(
555555
none.extract::<DateTime>().unwrap_err().to_string(),
556-
"TypeError: 'NoneType' object cannot be converted to 'PyDateTime'"
556+
"TypeError: 'NoneType' object cannot be converted to 'datetime'"
557557
);
558558
assert_eq!(
559559
none.extract::<Zoned>().unwrap_err().to_string(),
560-
"TypeError: 'NoneType' object cannot be converted to 'PyDateTime'"
560+
"TypeError: 'NoneType' object cannot be converted to 'datetime'"
561561
);
562562
});
563563
}

0 commit comments

Comments
 (0)