Commit b284081d authored by Stefan Behnel's avatar Stefan Behnel

Backed out changeset 7102647c1ecd

parent 049ebe24
...@@ -4210,9 +4210,10 @@ class SliceIndexNode(ExprNode): ...@@ -4210,9 +4210,10 @@ class SliceIndexNode(ExprNode):
if runtime_check: if runtime_check:
code.putln("if (unlikely((%s) != (%s))) {" % (runtime_check, target_size)) code.putln("if (unlikely((%s) != (%s))) {" % (runtime_check, target_size))
code.putln( code.putln(
'PyErr_Format(PyExc_ValueError,' 'PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length,'
' "Assignment to slice of wrong length, expected %%zd, got %%zd",' ' expected %%" CYTHON_FORMAT_SSIZE_T "d, got %%" CYTHON_FORMAT_SSIZE_T "d",'
' (Py_ssize_t)(%s), (Py_ssize_t)(%s));' % (target_size, runtime_check)) ' (Py_ssize_t)(%s), (Py_ssize_t)(%s));' % (
target_size, runtime_check))
code.putln(code.error_goto(self.pos)) code.putln(code.error_goto(self.pos))
code.putln("}") code.putln("}")
......
...@@ -481,7 +481,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { ...@@ -481,7 +481,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
offset = ctx->head->parent_offset + field->offset; offset = ctx->head->parent_offset + field->offset;
if (ctx->fmt_offset != offset) { if (ctx->fmt_offset != offset) {
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"Buffer dtype mismatch; next field is at offset %zd but %zd expected", "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
(Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
return -1; return -1;
} }
......
...@@ -64,7 +64,7 @@ static void __Pyx_RaiseArgtupleInvalid( ...@@ -64,7 +64,7 @@ static void __Pyx_RaiseArgtupleInvalid(
more_or_less = "exactly"; more_or_less = "exactly";
} }
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_TypeError,
"%.200s() takes %.8s %zd positional argument%.1s (%zd given)", "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
func_name, more_or_less, num_expected, func_name, more_or_less, num_expected,
(num_expected == 1) ? "" : "s", num_found); (num_expected == 1) ? "" : "s", num_found);
} }
......
...@@ -331,7 +331,8 @@ static int __Pyx_ValidateAndInit_memviewslice( ...@@ -331,7 +331,8 @@ static int __Pyx_ValidateAndInit_memviewslice(
if ((unsigned) buf->itemsize != dtype->size) { if ((unsigned) buf->itemsize != dtype->size) {
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"Item size of buffer (%zu byte%s) does not match size of '%s' (%zu byte%s)", "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
"does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
buf->itemsize, buf->itemsize,
(buf->itemsize > 1) ? "s" : "", (buf->itemsize > 1) ? "s" : "",
dtype->name, dtype->name,
......
...@@ -24,7 +24,8 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); ...@@ -24,7 +24,8 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
/////////////// RaiseTooManyValuesToUnpack /////////////// /////////////// RaiseTooManyValuesToUnpack ///////////////
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %zd)", expected); PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
} }
/////////////// RaiseNeedMoreValuesToUnpack.proto /////////////// /////////////// RaiseNeedMoreValuesToUnpack.proto ///////////////
...@@ -34,7 +35,8 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); ...@@ -34,7 +35,8 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
/////////////// RaiseNeedMoreValuesToUnpack /////////////// /////////////// RaiseNeedMoreValuesToUnpack ///////////////
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError, "need more than %zd value%.1s to unpack", PyErr_Format(PyExc_ValueError,
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
index, (index == 1) ? "" : "s"); index, (index == 1) ? "" : "s");
} }
......
...@@ -344,7 +344,8 @@ static CYTHON_INLINE Py_UCS4 __Pyx_PyObject_AsPy_UCS4(PyObject* x) { ...@@ -344,7 +344,8 @@ static CYTHON_INLINE Py_UCS4 __Pyx_PyObject_AsPy_UCS4(PyObject* x) {
#endif #endif
#endif #endif
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"only single character unicode strings can be converted to Py_UCS4, got length %zd", length); "only single character unicode strings can be converted to Py_UCS4, "
"got length %" CYTHON_FORMAT_SSIZE_T "d", length);
return (Py_UCS4)-1; return (Py_UCS4)-1;
} }
ival = __Pyx_PyInt_As_long(x); ival = __Pyx_PyInt_As_long(x);
...@@ -381,8 +382,8 @@ static CYTHON_INLINE Py_UNICODE __Pyx_PyObject_AsPy_UNICODE(PyObject* x) { ...@@ -381,8 +382,8 @@ static CYTHON_INLINE Py_UNICODE __Pyx_PyObject_AsPy_UNICODE(PyObject* x) {
if (PyUnicode_Check(x)) { if (PyUnicode_Check(x)) {
if (unlikely(__Pyx_PyUnicode_GET_LENGTH(x) != 1)) { if (unlikely(__Pyx_PyUnicode_GET_LENGTH(x) != 1)) {
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"only single character unicode strings can be converted to Py_UNICODE, got length %zd", "only single character unicode strings can be converted to Py_UNICODE, "
__Pyx_PyUnicode_GET_LENGTH(x)); "got length %" CYTHON_FORMAT_SSIZE_T "d", __Pyx_PyUnicode_GET_LENGTH(x));
return (Py_UNICODE)-1; return (Py_UNICODE)-1;
} }
#if CYTHON_PEP393_ENABLED #if CYTHON_PEP393_ENABLED
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment