Skip to content

Commit 4fa7504

Browse files
pslacerdacsabella
authored andcommitted
bpo-27268: Fix incorrect error message on float('') (pythonGH-2745)
1 parent 871ff77 commit 4fa7504

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎Python/pystrtod.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,15 +353,15 @@ PyOS_string_to_double(const char *s,
353353
else if (!endptr && (fail_pos == s || *fail_pos != '\0'))
354354
PyErr_Format(PyExc_ValueError,
355355
"could not convert string to float: "
356-
"%.200s", s);
356+
"'%.200s'", s);
357357
else if (fail_pos == s)
358358
PyErr_Format(PyExc_ValueError,
359359
"could not convert string to float: "
360-
"%.200s", s);
360+
"'%.200s'", s);
361361
else if (errno == ERANGE && fabs(x) >= 1.0 && overflow_exception)
362362
PyErr_Format(overflow_exception,
363363
"value too large to convert to float: "
364-
"%.200s", s);
364+
"'%.200s'", s);
365365
else
366366
result = x;
367367

0 commit comments

Comments
 (0)