def _formatTopics(self, irc, channel, topics, fit=False):
        topics = [s for s in topics if s and not s.isspace()]
        self.lastTopics[channel] = topics
        newTopic = self._joinTopic(channel, topics)
        try:
            maxLen = irc.state.supported['topiclen']
            if fit:
                while len(newTopic) > maxLen:
                    topics.pop(0)
                    self.lastTopics[channel] = topics
                    newTopic = self._joinTopic(channel, topics)
            elif len(newTopic) > maxLen:
                if self.registryValue('recognizeTopiclen', channel):
                    irc.error(format(_('That topic is too long for this '
                                       'server (maximum length: %i; this topic: '
                                       '%i).'), maxLen, len(newTopic)),
                              Raise=True)
        except __HOLE__:
            pass
        return newTopic
dataset/ETHPy150Open ProgVal/Limnoria/plugins/Topic/plugin.py/Topic._formatTopics