tiny cleanup, fix #163
authorStefan Behnel <scoder@users.berlios.de>
Fri, 19 Dec 2008 20:57:32 +0000 (21:57 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 19 Dec 2008 20:57:32 +0000 (21:57 +0100)
Cython/Compiler/Optimize.py

index 9780745ec7bce10d17924be3a8bd901540a41cf4..ea3d19b147e4add455b62585b752eb86d7d121b7 100644 (file)
@@ -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)