[Python-Dev] cpython: PyUnicode_FromKindAndData() raises a ValueError if the kind is unknown (original) (raw)
Georg Brandl g.brandl at gmx.net
Sun Oct 2 16:21:49 CEST 2011
- Previous message: [Python-Dev] Python Core Tools
- Next message: [Python-Dev] cpython: PyUnicode_FromKindAndData() raises a ValueError if the kind is unknown
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 10/02/11 01:14, victor.stinner wrote:
http://hg.python.org/cpython/rev/9124a00df142 changeset: 72573:9124a00df142 parent: 72571:fa0b1e50270f user: Victor Stinner <victor.stinner at haypocalc.com> date: Sat Oct 01 23:48:37 2011 +0200 summary: PyUnicodeFromKindAndData() raises a ValueError if the kind is unknown
files: Objects/unicodeobject.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1211,7 +1211,7 @@ case PyUnicode4BYTEKIND: return PyUnicodeFromUCS4(buffer, size); } - assert(0); + PyErrSetString(PyExcValueError, "invalid kind"); return NULL; }
Is that really a ValueError? It should only be a ValueError if the user could trigger that error. Otherwise it should be a SystemError.
Georg
- Previous message: [Python-Dev] Python Core Tools
- Next message: [Python-Dev] cpython: PyUnicode_FromKindAndData() raises a ValueError if the kind is unknown
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]