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
Boxiang Sun
cython
Commits
94f7b0eb
Commit
94f7b0eb
authored
Oct 06, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reduce number of distinct error format strings a bit
parent
f8233ea5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
Cython/Utility/Builtins.c
Cython/Utility/Builtins.c
+1
-1
Cython/Utility/TypeConversion.c
Cython/Utility/TypeConversion.c
+1
-1
tests/run/struct_conversion.pyx
tests/run/struct_conversion.pyx
+1
-1
No files found.
Cython/Utility/Builtins.c
View file @
94f7b0eb
...
...
@@ -201,7 +201,7 @@ static PyObject* __Pyx_Intern(PyObject* s); /* proto */
static
PyObject
*
__Pyx_Intern
(
PyObject
*
s
)
{
if
(
!
(
likely
(
PyString_CheckExact
(
s
))))
{
PyErr_Format
(
PyExc_TypeError
,
"Expected
str, got %s
"
,
Py_TYPE
(
s
)
->
tp_name
);
PyErr_Format
(
PyExc_TypeError
,
"Expected
%.16s, got %.200s"
,
"str
"
,
Py_TYPE
(
s
)
->
tp_name
);
return
0
;
}
Py_INCREF
(
s
);
...
...
Cython/Utility/TypeConversion.c
View file @
94f7b0eb
...
...
@@ -288,7 +288,7 @@ static {{struct_type_decl}} {{funcname}}(PyObject * o) {
PyObject
*
value
=
NULL
;
if
(
!
PyMapping_Check
(
o
))
{
PyErr_Format
(
PyExc_TypeError
,
"Expected
a mapping, not %s"
,
o
->
ob_type
->
tp_name
);
PyErr_Format
(
PyExc_TypeError
,
"Expected
%.16s, got %.200s"
,
"a mapping"
,
Py_TYPE
(
o
)
->
tp_name
);
goto
bad
;
}
...
...
tests/run/struct_conversion.pyx
View file @
94f7b0eb
...
...
@@ -87,7 +87,7 @@ def test_obj_to_struct(MyStruct mystruct):
>>> test_obj_to_struct(None)
Traceback (most recent call last):
...
TypeError: Expected a mapping,
n
ot NoneType
TypeError: Expected a mapping,
g
ot NoneType
>>> test_obj_to_struct(dict(s=b"world"))
Traceback (most recent call last):
...
...
...
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