Commit 555559f4 authored by Stefan Behnel's avatar Stefan Behnel

merge 0.20.x branch into master

parents 8939521b fd455597
...@@ -2875,7 +2875,8 @@ class CStructOrUnionType(CType): ...@@ -2875,7 +2875,8 @@ class CStructOrUnionType(CType):
if env.outer_scope is None: if env.outer_scope is None:
return False return False
if self._convert_to_py_code is False: return None # tri-state-ish if self._convert_to_py_code is False:
return None # tri-state-ish
if self._convert_to_py_code is None: if self._convert_to_py_code is None:
for member in self.scope.var_entries: for member in self.scope.var_entries:
...@@ -2893,7 +2894,8 @@ class CStructOrUnionType(CType): ...@@ -2893,7 +2894,8 @@ class CStructOrUnionType(CType):
if env.outer_scope is None: if env.outer_scope is None:
return False return False
if self._convert_from_py_code is False: return None # tri-state-ish if self._convert_from_py_code is False:
return None # tri-state-ish
if self._convert_from_py_code is None: if self._convert_from_py_code is None:
for member in self.scope.var_entries: for member in self.scope.var_entries:
......
"""
Note: this tests if the necessary utility code is included in the module env,
despite potentially being already created before.
"""
cdef extern from "struct_conversion_extern_header.h":
cdef struct my_date_t:
int year
int month
int day
def test_extern_struct():
"""
>>> test_extern_struct()
[('day', 24), ('month', 6), ('year', 2000)]
"""
cdef my_date_t day = my_date_t(year=2000, month=6, day=24)
cdef object d = day
assert type(d) is dict
assert d == day
return sorted(day.items())
struct my_date_t {
int year;
int month;
int day;
};
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