Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
b284081d
Commit
b284081d
authored
Oct 29, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backed out changeset 7102647c1ecd
parent
049ebe24
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
11 deletions
+16
-11
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+4
-3
Cython/Utility/Buffer.c
Cython/Utility/Buffer.c
+1
-1
Cython/Utility/FunctionArguments.c
Cython/Utility/FunctionArguments.c
+1
-1
Cython/Utility/MemoryView_C.c
Cython/Utility/MemoryView_C.c
+2
-1
Cython/Utility/ObjectHandling.c
Cython/Utility/ObjectHandling.c
+4
-2
Cython/Utility/TypeConversion.c
Cython/Utility/TypeConversion.c
+4
-3
No files found.
Cython/Compiler/ExprNodes.py
View file @
b284081d
...
...
@@ -4210,9 +4210,10 @@ class SliceIndexNode(ExprNode):
if
runtime_check
:
code
.
putln
(
"if (unlikely((%s) != (%s))) {"
%
(
runtime_check
,
target_size
))
code
.
putln
(
'PyErr_Format(PyExc_ValueError,'
' "Assignment to slice of wrong length, expected %%zd, got %%zd",'
' (Py_ssize_t)(%s), (Py_ssize_t)(%s));'
%
(
target_size
,
runtime_check
))
'PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length,'
' expected %%" CYTHON_FORMAT_SSIZE_T "d, got %%" CYTHON_FORMAT_SSIZE_T "d",'
' (Py_ssize_t)(%s), (Py_ssize_t)(%s));'
%
(
target_size
,
runtime_check
))
code
.
putln
(
code
.
error_goto
(
self
.
pos
))
code
.
putln
(
"}"
)
...
...
Cython/Utility/Buffer.c
View file @
b284081d
...
...
@@ -481,7 +481,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
offset
=
ctx
->
head
->
parent_offset
+
field
->
offset
;
if
(
ctx
->
fmt_offset
!=
offset
)
{
PyErr_Format
(
PyExc_ValueError
,
"Buffer dtype mismatch; next field is at offset %
zd but %z
d 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
);
return
-
1
;
}
...
...
Cython/Utility/FunctionArguments.c
View file @
b284081d
...
...
@@ -64,7 +64,7 @@ static void __Pyx_RaiseArgtupleInvalid(
more_or_less
=
"exactly"
;
}
PyErr_Format
(
PyExc_TypeError
,
"%.200s() takes %.8s %
zd positional argument%.1s (%z
d 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
,
(
num_expected
==
1
)
?
""
:
"s"
,
num_found
);
}
...
...
Cython/Utility/MemoryView_C.c
View file @
b284081d
...
...
@@ -331,7 +331,8 @@ static int __Pyx_ValidateAndInit_memviewslice(
if
((
unsigned
)
buf
->
itemsize
!=
dtype
->
size
)
{
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
>
1
)
?
"s"
:
""
,
dtype
->
name
,
...
...
Cython/Utility/ObjectHandling.c
View file @
b284081d
...
...
@@ -24,7 +24,8 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
/////////////// RaiseTooManyValuesToUnpack ///////////////
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 ///////////////
...
...
@@ -34,7 +35,8 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
/////////////// RaiseNeedMoreValuesToUnpack ///////////////
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"
);
}
...
...
Cython/Utility/TypeConversion.c
View file @
b284081d
...
...
@@ -344,7 +344,8 @@ static CYTHON_INLINE Py_UCS4 __Pyx_PyObject_AsPy_UCS4(PyObject* x) {
#endif
#endif
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
;
}
ival
=
__Pyx_PyInt_As_long
(
x
);
...
...
@@ -381,8 +382,8 @@ static CYTHON_INLINE Py_UNICODE __Pyx_PyObject_AsPy_UNICODE(PyObject* x) {
if
(
PyUnicode_Check
(
x
))
{
if
(
unlikely
(
__Pyx_PyUnicode_GET_LENGTH
(
x
)
!=
1
))
{
PyErr_Format
(
PyExc_ValueError
,
"only single character unicode strings can be converted to Py_UNICODE,
got length %zd"
,
__Pyx_PyUnicode_GET_LENGTH
(
x
));
"only single character unicode strings can be converted to Py_UNICODE,
"
"got length %"
CYTHON_FORMAT_SSIZE_T
"d"
,
__Pyx_PyUnicode_GET_LENGTH
(
x
));
return
(
Py_UNICODE
)
-
1
;
}
#if CYTHON_PEP393_ENABLED
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment