summaryrefslogtreecommitdiffstats
path: root/Objects/longobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r--Objects/longobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index ae62cfd..3aa518b 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -271,12 +271,12 @@ PyLong_FromDouble(double dval)
neg = 0;
if (Py_IS_INFINITY(dval)) {
PyErr_SetString(PyExc_OverflowError,
- "cannot convert float infinity to int");
+ "cannot convert float infinity to integer");
return NULL;
}
if (Py_IS_NAN(dval)) {
- PyErr_SetString(PyExc_OverflowError,
- "cannot convert float NaN to int");
+ PyErr_SetString(PyExc_ValueError,
+ "cannot convert float NaN to integer");
return NULL;
}
if (dval < 0.0) {