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: > PyUnicode_FromKindAndData() 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 PyUnicode_4BYTE_KIND: > return _PyUnicode_FromUCS4(buffer, size); > } > - assert(0); > + PyErr_SetString(PyExc_ValueError, "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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4