[Python] Make Python module compatible with Cython 0.26
Cython 0.26 unexpectedly removed automatic conversions of C++ containers to Python containers. Explicit casting provides the old behavior. Fixes #465
This commit is contained in:
parent
3676672eec
commit
8d953a9424
1 changed files with 2 additions and 2 deletions
|
|
@ -58,12 +58,12 @@ cdef Composition comp_map(X) except *:
|
|||
|
||||
# assume X is dict-like
|
||||
cdef Composition m
|
||||
for species,value in X.items():
|
||||
for species,value in (<object>X).items():
|
||||
m[stringify(species)] = value
|
||||
return m
|
||||
|
||||
cdef comp_map_to_dict(Composition m):
|
||||
return {pystr(species):value for species,value in m.items()}
|
||||
return {pystr(species):value for species,value in (<object>m).items()}
|
||||
|
||||
class CanteraError(RuntimeError):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue