Commit add0b074 authored by Lisandro Dalcin's avatar Lisandro Dalcin

quick fix for bug introduced in commit 3d7f9142d2f0

parent 0844f356
...@@ -805,7 +805,7 @@ class CIntType(CNumericType): ...@@ -805,7 +805,7 @@ class CIntType(CNumericType):
self.from_py_function = self.get_from_py_type_conversion() self.from_py_function = self.get_from_py_type_conversion()
def get_to_py_type_conversion(self): def get_to_py_type_conversion(self):
if self.rank < rank_to_type_name.index('int'): if self.rank < list(rank_to_type_name).index('int'):
# This assumes sizeof(short) < sizeof(int) # This assumes sizeof(short) < sizeof(int)
return "PyInt_FromLong" return "PyInt_FromLong"
else: else:
...@@ -816,7 +816,7 @@ class CIntType(CNumericType): ...@@ -816,7 +816,7 @@ class CIntType(CNumericType):
if not self.signed: if not self.signed:
Prefix = "Long" Prefix = "Long"
SignWord = "Unsigned" SignWord = "Unsigned"
if self.rank == rank_to_type_name.index('PY_LONG_LONG'): if self.rank >== list(rank_to_type_name).index('PY_LONG_LONG'):
Prefix = "Long" Prefix = "Long"
TypeName = "LongLong" TypeName = "LongLong"
return "Py%s_From%s%s" % (Prefix, SignWord, TypeName) return "Py%s_From%s%s" % (Prefix, SignWord, TypeName)
......
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