From 83198d1bb60f5593e3313984a4c8b087f89429d1 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Tue, 23 Sep 2008 10:38:51 -0700 Subject: [PATCH] Fix isinstance bug discovered by Lisandro Dalcin --- Cython/Compiler/Optimize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py index 64a410b9..000b12ad 100644 --- a/Cython/Compiler/Optimize.py +++ b/Cython/Compiler/Optimize.py @@ -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': -- 2.26.2