Skip to content

Commit c60d65c

Browse files
committed
Fixes pydantic#9235
1 parent e1fc99d commit c60d65c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/serializers/type_serializers/literal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl LiteralSerializer {
8989
if let Ok(py_str) = value.downcast::<PyString>() {
9090
let s = py_str.to_str()?;
9191
if self.expected_str.contains(s) {
92-
return Ok(OutputValue::OkStr(py_str.clone()));
92+
return Ok(OutputValue::OkStr(PyString::new_bound(value.py(), s)));
9393
}
9494
}
9595
}

0 commit comments

Comments
 (0)