Skip to content

Commit

Permalink
Merge pull request numpy#14472 from WarrenWeckesser/rational-str
Browse files Browse the repository at this point in the history
BUG: core: Fix the str function of the rational dtype.
  • Loading branch information
seberg authored Sep 11, 2019
2 parents bdc5e42 + 631ce49 commit bc2d265
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions numpy/core/src/umath/_rational_tests.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,11 @@ static PyObject*
pyrational_str(PyObject* self) {
rational x = ((PyRational*)self)->r;
if (d(x)!=1) {
return PyString_FromFormat(
return PyUString_FromFormat(
"%ld/%ld",(long)x.n,(long)d(x));
}
else {
return PyString_FromFormat(
return PyUString_FromFormat(
"%ld",(long)x.n);
}
}
Expand Down

0 comments on commit bc2d265

Please sign in to comment.