fix type check as 'slice'
authorStefan Behnel <scoder@users.berlios.de>
Fri, 3 Dec 2010 15:49:43 +0000 (16:49 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 3 Dec 2010 15:49:43 +0000 (16:49 +0100)
Cython/Compiler/PyrexTypes.py

index 77d96f844c7a409a1ae07c7f63bbe01a12f3c07b..4462ca31f2f19df503bfd7852269f6024678826f 100755 (executable)
@@ -415,16 +415,13 @@ class BuiltinObjectType(PyObjectType):
 
     def type_check_function(self, exact=True):
         type_name = self.name
-        if type_name == 'bool':
-            return 'PyBool_Check'
-
         if type_name == 'str':
             type_check = 'PyString_Check'
         elif type_name == 'frozenset':
             type_check = 'PyFrozenSet_Check'
         else:
             type_check = 'Py%s_Check' % type_name.capitalize()
-        if exact:
+        if exact and type_name not in ('bool', 'slice'):
             type_check += 'Exact'
         return type_check