diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-09-06 17:07:17 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-09-06 17:07:17 (GMT) |
commit | d8a1447c9980be5f1d8ae806f7aecd814b1cd6f6 (patch) | |
tree | a1966e33692ba9de3966c9760957233f51142cb2 /Modules/_tkinter.c | |
parent | 4a4b67951570a8a0452c77a5ebaa98b9ef9fb712 (diff) | |
download | cpython-d8a1447c9980be5f1d8ae806f7aecd814b1cd6f6.zip cpython-d8a1447c9980be5f1d8ae806f7aecd814b1cd6f6.tar.gz cpython-d8a1447c9980be5f1d8ae806f7aecd814b1cd6f6.tar.bz2 |
Issue #22215: Now ValueError is raised instead of TypeError when str or bytes
argument contains not permitted null character or byte.
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r-- | Modules/_tkinter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 4df45ad..d54ebb4 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -1417,7 +1417,7 @@ varname_converter(PyObject *in, void *_out) } s = PyBytes_AsString(in); if (strlen(s) != (size_t)PyBytes_Size(in)) { - PyErr_SetString(PyExc_ValueError, "null byte in bytes object"); + PyErr_SetString(PyExc_ValueError, "embedded null byte"); return 0; } *out = s; @@ -1434,7 +1434,7 @@ varname_converter(PyObject *in, void *_out) return 0; } if (strlen(s) != (size_t)size) { - PyErr_SetString(PyExc_ValueError, "null character in string"); + PyErr_SetString(PyExc_ValueError, "embedded null character"); return 0; } *out = s; |