Fix isinstance bug discovered by Lisandro Dalcin
authorRobert Bradshaw <robertwb@math.washington.edu>
Tue, 23 Sep 2008 17:38:51 +0000 (10:38 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Tue, 23 Sep 2008 17:38:51 +0000 (10:38 -0700)
Cython/Compiler/Optimize.py

index 64a410b9254c4a203a61099914c65f1f43f7f4aa..000b12ade006288dd84ffa38e267820c6afcbc8a 100644 (file)
@@ -162,7 +162,7 @@ class FinalOptimizePhase(Visitor.CythonTransform):
 
     def visit_SimpleCallNode(self, node):
         self.visitchildren(node)
-        if node.function.type.is_cfunction:
+        if node.function.type.is_cfunction and isinstance(node.function, ExprNodes.NameNode):
             if node.function.name == 'isinstance':
                 type_arg = node.args[1]
                 if type_arg.type.is_builtin_type and type_arg.type.name == 'type':