travis.yml: Fix tests runner for Python 2.

This commit is contained in:
Valentin Lorentz 2013-06-17 11:03:50 +00:00
parent 9e4c804d24
commit 34b8e53c38
3 changed files with 6 additions and 3 deletions

View File

@ -12,4 +12,4 @@ install:
script:
- echo $TRAVIS_PYTHON_VERSION
- python setup.py install
- supybot-test test --plugins-dir=./build/lib/supybot/plugins/ --no-network --disable-multiprocessing
- supybot-test test --plugins-dir=./build/lib*/supybot/plugins/ --no-network --disable-multiprocessing

View File

@ -262,7 +262,7 @@ class Karma(callbacks.Plugin):
def invalidCommand(self, irc, msg, tokens):
channel = msg.args[0]
if not irc.isChannel(channel):
if not irc.isChannel(channel) or not tokens:
return
if tokens[-1][-2:] in ('++', '--'):
thing = ' '.join(tokens)

View File

@ -88,6 +88,7 @@ class Misc(callbacks.Plugin):
def invalidCommand(self, irc, msg, tokens):
assert not msg.repliedTo, 'repliedTo msg in Misc.invalidCommand.'
assert self is irc.callbacks[-1], 'Misc isn\'t last callback.'
assert msg.command in ('PRIVMSG', 'NOTICE')
self.log.debug('Misc.invalidCommand called (tokens %s)', tokens)
# First, we check for invalidCommand floods. This is rightfully done
# here since this will be the last invalidCommand called, and thus it
@ -125,7 +126,9 @@ class Misc(callbacks.Plugin):
banmasker = conf.supybot.protocols.irc.banmask.makeBanmask
self.invalidCommands.enqueue(msg)
if self.invalidCommands.len(msg) > maximum and \
not ircdb.checkCapability(msg.prefix, 'owner'):
not ircdb.checkCapability(msg.prefix, 'owner') and \
msg.prefix != irc.prefix and \
ircutils.isUserHostmask(msg.prefix):
penalty = conf.supybot.abuse.flood.command.invalid.punishment()
banmask = banmasker(msg.prefix, channel=None)
self.log.info('Ignoring %s for %s seconds due to an apparent '