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
770acb7d
Commit
770acb7d
authored
Jul 23, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed stl container conversion with typedef element types.
parent
d6719b66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
CHANGES.rst
CHANGES.rst
+2
-0
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+20
-2
No files found.
CHANGES.rst
View file @
770acb7d
...
...
@@ -93,6 +93,8 @@ Bugs fixed
runtime but not as global module names. Trying both lookups helps with
globals() manipulation.
* Fixed stl container conversion for typedef element types.
* ``obj.pop(x)`` truncated large C integer values of x to ``Py_ssize_t``.
* ``__init__.pyc`` is recognised as marking a package directory
...
...
Cython/Compiler/PyrexTypes.py
View file @
770acb7d
...
...
@@ -3023,12 +3023,30 @@ class CppClassType(CType):
return
False
tags
.
append
(
T
.
specialization_name
())
if
T
.
exception_value
is
not
None
:
except_clause
=
T
.
exception_value
# This is a hack due to the except value clause
# requiring a const (literal) value of the right
# (visible) type.
def
guess_type
(
value
):
if
not
T
.
is_typedef
and
(
T
.
is_numeric
or
T
.
is_ptr
):
return
T
try
:
int
(
value
)
return
c_longlong_type
except
ValueError
:
pass
try
:
float
(
value
)
return
c_double_type
except
ValueError
:
pass
return
T
except_type
=
guess_type
(
T
.
exception_value
)
except_clause
=
"%s "
%
T
.
exception_value
if
T
.
exception_check
:
except_clause
=
"? %s"
%
except_clause
declarations
.
append
(
" ctypedef %s %s '%s'"
%
(
T
.
declaration_code
(
""
,
for_display
=
True
),
X
[
ix
],
T
.
declaration_code
(
""
)))
except_type
.
declaration_code
(
""
,
for_display
=
True
),
X
[
ix
],
T
.
declaration_code
(
""
)))
else
:
except_clause
=
"*"
declarations
.
append
(
...
...
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