Browse Source

Fix py37 unit test error

Change-Id: If252c58546a60630dff9427acb9a6ff2cc8244ca
zhurong 2 months ago
parent
commit
9f4287ccc3
1 changed files with 12 additions and 6 deletions
  1. 12
    6
      murano/dsl/helpers.py

+ 12
- 6
murano/dsl/helpers.py View File

@@ -737,10 +737,16 @@ def walk_gc(obj, towards, handler):
737 737
 
738 738
         visited.add(id(item))
739 739
         if towards:
740
-            queue.extend(
741
-                [(t, trace + [item]) for t in gc.get_referrers(item)]
742
-            )
740
+            try:
741
+                queue.extend(
742
+                    [(t, trace + [item]) for t in gc.get_referrers(item)]
743
+                )
744
+            except StopIteration:
745
+                return
743 746
         else:
744
-            queue.extend(
745
-                [(t, [item] + trace) for t in gc.get_referents(item)]
746
-            )
747
+            try:
748
+                queue.extend(
749
+                    [(t, [item] + trace) for t in gc.get_referents(item)]
750
+                )
751
+            except StopIteration:
752
+                return

Loading…
Cancel
Save