old_contents: from pythonwarrior.abilities.base import AbilityBase
  
  
  class Listen(AbilityBase):
      def description(self):
          return "Returns an array of all spaces which have units in them."
  
      def perform(self):
          def _filter_out_main(item):
              return (item and item != self._unit)
  
          units = filter(_filter_out_main, self._unit.position.floor.units)
  
          units = filter(lambda x: x, units)
          return units
  
new_contents: from pythonwarrior.abilities.base import AbilityBase
  
  
  class Listen(AbilityBase):
      def description(self):
          return "Returns an array of all spaces which have units in them."
  
      def perform(self):
          def _collect_non_warrior_spaces(unit):
              if unit and unit != self._unit:
                  return unit.position.space()
  
          units = map(_collect_non_warrior_spaces,
                      self._unit.position.floor.units)
          units = filter(lambda x: x, units)
  
          return units
  
subject: Fix listen ability return Space objects