fix circular import
authorStefan Behnel <stefan_ml@behnel.de>
Tue, 17 Jul 2012 11:26:26 +0000 (13:26 +0200)
committerStefan Behnel <stefan_ml@behnel.de>
Tue, 17 Jul 2012 11:26:26 +0000 (13:26 +0200)
Cython/Compiler/ParseTreeTransforms.py

index db90141..94e64f9 100644 (file)
@@ -2591,14 +2591,12 @@ class ReplaceFusedTypeChecks(VisitorTransform):
         elif fused_t in other_fused_type:
             ...
     """
-
-    # Defer the import until now to avoid circularity...
-    from Cython.Compiler import Optimize
-    transform = Optimize.ConstantFolding(reevaluate=True)
-
     def __init__(self, local_scope):
         super(ReplaceFusedTypeChecks, self).__init__()
         self.local_scope = local_scope
+        # defer the import until now to avoid circular import time dependencies
+        from Cython.Compiler import Optimize
+        self.transform = Optimize.ConstantFolding(reevaluate=True)
 
     def visit_IfStatNode(self, node):
         """