quick fix for bug introduced in commit 3d7f9142d2f0
authorLisandro Dalcin <dalcinl@gmail.com>
Wed, 14 Apr 2010 17:14:11 +0000 (14:14 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Wed, 14 Apr 2010 17:14:11 +0000 (14:14 -0300)
Cython/Compiler/PyrexTypes.py

index 4822c8f6072bbb6dfa59df39c36f1e3fc095af35..23dceaf6a1a0db3bfce622a40ea7e290a3b1ea78 100755 (executable)
@@ -805,7 +805,7 @@ class CIntType(CNumericType):
             self.from_py_function = self.get_from_py_type_conversion()
 
     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)
             return "PyInt_FromLong"
         else:
@@ -816,7 +816,7 @@ class CIntType(CNumericType):
             if not self.signed:
                 Prefix = "Long"
                 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"
                 TypeName = "LongLong"
             return "Py%s_From%s%s" % (Prefix, SignWord, TypeName)