From d15bbcd442ca488df7740a12d674669172499fa7 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Thu, 15 Apr 2010 16:20:11 +0200 Subject: [PATCH] fix coercion optimisation --- Cython/Compiler/Optimize.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py index cb2666e9..c9b24851 100644 --- a/Cython/Compiler/Optimize.py +++ b/Cython/Compiler/Optimize.py @@ -1044,6 +1044,8 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform): """ self.visitchildren(node) arg = node.arg + if isinstance(arg, ExprNodes.PyTypeTestNode): + arg = arg.arg if isinstance(arg, ExprNodes.CoerceToPyTypeNode): if arg.type in (PyrexTypes.py_object_type, Builtin.bool_type): return arg.arg.coerce_to_boolean(self.current_env()) -- 2.26.2