fix for infinite loop in buffer code
authorDagSverreSeljebotn <none@none>
Tue, 25 Nov 2008 20:30:05 +0000 (12:30 -0800)
committerDagSverreSeljebotn <none@none>
Tue, 25 Nov 2008 20:30:05 +0000 (12:30 -0800)
Cython/Compiler/Buffer.py

index c53a5ca4dec169dc49414fc04d6cfd6354ec9d1b..ad1bce58ab869b0dd7a37a7de21bccdbc66dc414 100644 (file)
@@ -710,7 +710,11 @@ def use_py2_buffer_functions(env):
 
     # Search all types for __getbuffer__ overloads
     types = []
+    visited_scopes = set()
     def find_buffer_types(scope):
+        if scope in visited_scopes:
+            return
+        visited_scopes.add(scope)
         for m in scope.cimported_modules:
             find_buffer_types(m)
         for e in scope.type_entries: