[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:
Ray Speth 2017-07-28 23:54:31 -04:00
parent 3676672eec
commit 8d953a9424

View file

@ -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