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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
9db5c060
Commit
9db5c060
authored
Jun 20, 2017
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use struct type rather than its name in conversion utility code.
This fixes #1739.
parent
5528995c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+1
-1
Cython/Utility/CConvert.pyx
Cython/Utility/CConvert.pyx
+4
-4
No files found.
Cython/Compiler/PyrexTypes.py
View file @
9db5c060
...
...
@@ -3204,7 +3204,7 @@ class CStructOrUnionType(CType):
return
False
context
=
dict
(
struct_
name
=
self
.
name
,
struct_
type
=
self
,
var_entries
=
self
.
scope
.
var_entries
,
funcname
=
self
.
from_py_function
,
)
...
...
Cython/Utility/CConvert.pyx
View file @
9db5c060
...
...
@@ -8,8 +8,8 @@ cdef extern from *:
object
PyErr_Format
(
exc
,
const
char
*
format
,
...)
@
cname
(
"{{funcname}}"
)
cdef
{{
struct_
nam
e
}}
{{
funcname
}}(
obj
)
except
*
:
cdef
{{
struct_
nam
e
}}
result
cdef
{{
struct_
typ
e
}}
{{
funcname
}}(
obj
)
except
*
:
cdef
{{
struct_
typ
e
}}
result
if
not
PyMapping_Check
(
obj
):
PyErr_Format
(
TypeError
,
b"Expected %.16s, got %.200s"
,
b"a mapping"
,
Py_TYPE
(
obj
).
tp_name
)
...
...
@@ -33,8 +33,8 @@ cdef extern from *:
object
PyErr_Format
(
exc
,
const
char
*
format
,
...)
@
cname
(
"{{funcname}}"
)
cdef
{{
struct_
nam
e
}}
{{
funcname
}}(
obj
)
except
*
:
cdef
{{
struct_
nam
e
}}
result
cdef
{{
struct_
typ
e
}}
{{
funcname
}}(
obj
)
except
*
:
cdef
{{
struct_
typ
e
}}
result
cdef
Py_ssize_t
length
if
not
PyMapping_Check
(
obj
):
PyErr_Format
(
TypeError
,
b"Expected %.16s, got %.200s"
,
b"a mapping"
,
Py_TYPE
(
obj
).
tp_name
)
...
...
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