Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5cfd837

Browse files
committed
Improve wording of parser error message.
1 parent 7f2053e commit 5cfd837

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/_csv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ parse_process_char(ReaderObj *self, char c)
717717
else {
718718
/* illegal */
719719
self->had_parse_error = 1;
720-
PyErr_Format(error_obj, "%c expected after %c",
720+
PyErr_Format(error_obj, "'%c' expected after '%c'",
721721
dialect->delimiter,
722722
dialect->quotechar);
723723
return -1;
@@ -1354,7 +1354,7 @@ csv_writer(PyObject *module, PyObject *args, PyObject *keyword_args)
13541354
self->writeline = PyObject_GetAttrString(output_file, "write");
13551355
if (self->writeline == NULL || !PyCallable_Check(self->writeline)) {
13561356
PyErr_SetString(PyExc_TypeError,
1357-
"argument 1 must be an instance with a write method");
1357+
"argument 1 must have a \"write\" method");
13581358
Py_DECREF(self);
13591359
return NULL;
13601360
}

0 commit comments

Comments
 (0)