(obj, start, all, current_path)
| 779 | outstream.write("\n") |
| 780 | |
| 781 | def recurse(obj, start, all, current_path): |
| 782 | if show_progress: |
| 783 | outstream.write("%d\r" % len(all)) |
| 784 | |
| 785 | all[id(obj)] = None |
| 786 | |
| 787 | referents = gc.get_referents(obj) |
| 788 | for referent in referents: |
| 789 | # If we've found our way back to the start, this is |
| 790 | # a cycle, so print it out |
| 791 | if referent is start: |
| 792 | print_path(current_path) |
| 793 | |
| 794 | # Don't go back through the original list of objects, or |
| 795 | # through temporary references to the object, since those |
| 796 | # are just an artifact of the cycle detector itself. |
| 797 | elif referent is objects or isinstance(referent, types.FrameType): |
| 798 | continue |
| 799 | |
| 800 | # We haven't seen this object before, so recurse |
| 801 | elif id(referent) not in all: |
| 802 | recurse(referent, start, all, current_path + [obj]) |
| 803 | |
| 804 | for obj in objects: |
| 805 | outstream.write(f"Examining: {obj!r}\n") |
no test coverage detected
searching dependent graphs…