Commit 4fa7504e authored by Pedro Lacerda's avatar Pedro Lacerda Committed by Cheryl Sabella

bpo-27268: Fix incorrect error message on float('') (GH-2745)

parent 871ff77c
...@@ -353,15 +353,15 @@ PyOS_string_to_double(const char *s, ...@@ -353,15 +353,15 @@ PyOS_string_to_double(const char *s,
else if (!endptr && (fail_pos == s || *fail_pos != '\0')) else if (!endptr && (fail_pos == s || *fail_pos != '\0'))
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"could not convert string to float: " "could not convert string to float: "
"%.200s", s); "'%.200s'", s);
else if (fail_pos == s) else if (fail_pos == s)
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"could not convert string to float: " "could not convert string to float: "
"%.200s", s); "'%.200s'", s);
else if (errno == ERANGE && fabs(x) >= 1.0 && overflow_exception) else if (errno == ERANGE && fabs(x) >= 1.0 && overflow_exception)
PyErr_Format(overflow_exception, PyErr_Format(overflow_exception,
"value too large to convert to float: " "value too large to convert to float: "
"%.200s", s); "'%.200s'", s);
else else
result = x; result = x;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment