code: def try_one_generator (project, name, generator, target_type, properties, sources):
      
      if __debug__:
          from .targets import ProjectTarget
          assert isinstance(project, ProjectTarget)
          assert isinstance(name, basestring) or name is None
          assert isinstance(generator, Generator)
          assert isinstance(target_type, basestring)
          assert isinstance(properties, property_set.PropertySet)
          assert is_iterable_typed(sources, virtual_target.VirtualTarget)
      source_types = []
  
      for s in sources:
          source_types.append (s.type ())
  
      viable_source_types = viable_source_types_for_generator (generator)
  
      if source_types and viable_source_types != ['*'] and\
             not set_.intersection (source_types, viable_source_types):
          if project.manager ().logger ().on ():
              id = generator.id ()
              project.manager ().logger ().log (__name__, "generator '%s' pruned" % id)
              project.manager ().logger ().log (__name__, "source_types" '%s' % source_types)
              project.manager ().logger ().log (__name__, "viable_source_types '%s'" % viable_source_types)
  
          return []
  
      else:
          return try_one_generator_really (project, name, generator, target_type, properties, sources)
docs: Checks if generator invocation can be pruned, because it's guaranteed
          to fail. If so, quickly returns empty list. Otherwise, calls
          try_one_generator_really.