From 84238b4883e6b170c69c77df4a2858d96cd29f8a Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 19 Dec 2008 21:57:32 +0100 Subject: [PATCH] tiny cleanup, fix #163 --- Cython/Compiler/Optimize.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py index 9780745e..ea3d19b1 100644 --- a/Cython/Compiler/Optimize.py +++ b/Cython/Compiler/Optimize.py @@ -101,8 +101,7 @@ class IterationTransform(Visitor.VisitorTransform): isinstance(function, ExprNodes.NameNode) and \ function.entry.is_builtin and \ function.name in ('range', 'xrange'): - return self._transform_range_iteration( - node, iterator) + return self._transform_range_iteration(node, iterator) return node @@ -453,6 +452,8 @@ class FlattenBuiltinTypeCreation(Visitor.VisitorTransform): def _find_handler(self, call_type, function): if not function.type.is_builtin_type: return None + if not isinstance(function, ExprNodes.NameNode): + return None handler = getattr(self, '_handle_%s_%s' % (call_type, function.name), None) if handler is None: handler = getattr(self, '_handle_any_%s' % function.name, None) -- 2.26.2