> > - 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. You are right, ValueError is not best exception here. I used SystemError instead: see my commit 721bb2e59815. PyUnicode_FromFormat() does still use ValueError in PyUnicode_FromFormatV: PyErr_SetString(PyExc_ValueError, "incomplete format key"); PyErr_SetString(PyExc_ValueError, "width too big"); PyErr_SetString(PyExc_ValueError, "prec too big"); PyErr_SetString(PyExc_ValueError, "incomplete format"); PyErr_Format(PyExc_ValueError, "unsupported format character '%c' (0x%x) " "at index %zd", (31<=c && c<=126) ? (char)c : '?', (int)c, fmtpos - 1); PyErr_Format(PyExc_ValueError, "PyUnicode_FromFormatV() expects an ASCII-encoded format " "string, got a non-ASCII byte: 0x%02x", (unsigned char)*f); Should we also replace them by SystemError? It might break backward compatibility, but I do really hope that nobody relies on these errors ;-) Victor
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