Skip to content

Commit f94522b

Browse files
committed
simplify a bit using PyObject_Str
1 parent 788d3ac commit f94522b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stringdtype/stringdtype/src/dtype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ get_value(PyObject *scalar, StringDType_type *cls)
8181
else if (!((scalar_type == &PyUnicode_Type) ||
8282
(scalar_type == expected_scalar_type))) {
8383
// attempt to coerce to str
84-
scalar = PyObject_CallOneArg((PyObject *)&PyUnicode_Type, scalar);
84+
scalar = PyObject_Str(scalar);
8585
if (scalar == NULL) {
8686
// __str__ raised an exception
8787
return NULL;

0 commit comments

Comments
 (0)