summaryrefslogtreecommitdiffstats
path: root/Modules/_sre.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-03-25 19:03:47 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-03-25 19:03:47 (GMT)
commit632a77e6a3fb3acec9850cd5245dc28314000e54 (patch)
tree2f3d5fb838d0fad895465a63a1fcc767c4f52bf9 /Modules/_sre.c
parent7c316a181a38d97a1af7da8199c5b6dfcb25b450 (diff)
downloadcpython-632a77e6a3fb3acec9850cd5245dc28314000e54.zip
cpython-632a77e6a3fb3acec9850cd5245dc28314000e54.tar.gz
cpython-632a77e6a3fb3acec9850cd5245dc28314000e54.tar.bz2
Issue #22364: Improved some re error messages using regex for hints.
Diffstat (limited to 'Modules/_sre.c')
-rw-r--r--Modules/_sre.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_sre.c b/Modules/_sre.c
index 9550d97..83eb963 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -315,7 +315,7 @@ getstring(PyObject* string, Py_ssize_t* p_length,
/* get pointer to byte string buffer */
if (PyObject_GetBuffer(string, view, PyBUF_SIMPLE) != 0) {
- PyErr_SetString(PyExc_TypeError, "expected string or buffer");
+ PyErr_SetString(PyExc_TypeError, "expected string or bytes-like object");
return NULL;
}
@@ -359,12 +359,12 @@ state_init(SRE_STATE* state, PatternObject* pattern, PyObject* string,
if (isbytes && pattern->isbytes == 0) {
PyErr_SetString(PyExc_TypeError,
- "can't use a string pattern on a bytes-like object");
+ "cannot use a string pattern on a bytes-like object");
goto err;
}
if (!isbytes && pattern->isbytes > 0) {
PyErr_SetString(PyExc_TypeError,
- "can't use a bytes pattern on a string-like object");
+ "cannot use a bytes pattern on a string-like object");
goto err;
}