code: def cleanup(self):
          
          if not self.pending_children:
              return
  
          nclist = [(n, find_cycle([n], set())) for n in self.pending_children]
  
          genuine_cycles = [
              node for node,cycle in nclist
                       if cycle or node.get_state() != NODE_EXECUTED
          ]
          if not genuine_cycles:
              # All of the "cycles" found were single nodes in EXECUTED state,
              # which is to say, they really weren't cycles.  Just return.
              return
  
          desc = 'Found dependency cycle(s):\n'
          for node, cycle in nclist:
              if cycle:
                  desc = desc + "  " + " -> ".join(map(str, cycle)) + "\n"
              else:
                  desc = desc + \
                      "  Internal Error: no cycle found for node %s (%s) in state %s\n" %  \
                      (node, repr(node), StateString[node.get_state()])
  
          raise SCons.Errors.UserError(desc)
docs: Check for dependency cycles.