Admin: Fix python 3.4 support.

This commit is contained in:
Valentin Lorentz 2021-05-25 18:59:02 +02:00
parent fa3707ed66
commit 710d16f301
4 changed files with 10 additions and 3 deletions

View File

@ -355,7 +355,7 @@ class Admin(callbacks.Plugin):
Perform <command> (with associated <arg>s on all channels on current network."""
for channel in irc.state.channels:
msg = ircmsgs.IrcMsg(msg=msg, args=(channel, *msg.args[1:]))
msg = ircmsgs.IrcMsg(msg=msg, args=(channel,) + msg.args[1:])
self.Proxy(irc.getRealIrc(), msg, commandAndArgs)
acmd = wrap(acmd, ['admin', many('something')])

View File

@ -132,7 +132,7 @@ class AdminTestCase(PluginTestCase):
msgs.append(msg)
msg = self.irc.takeMsg()
self.assertCountEqual(
[(msg.command, *msg.args) for msg in msgs],
[(msg.command,) + msg.args for msg in msgs],
[("PRIVMSG", "#foo", "hi #foo"), ("PRIVMSG", "#bar", "hi #bar")])
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:

View File

@ -209,7 +209,14 @@ class User(callbacks.Plugin):
password>. Obviously this message must be sent to the bot
privately (not in a channel). If the requesting user is an owner
user, then <old password> needn't be correct.
If the <new password> is "!", password login will be disabled.
"""
if password == "!":
password = None
elif len(password) < 3:
irc.error(_('The password must be at least 3 characters long.'),
Raise=True)
try:
u = ircdb.users.getUser(msg.prefix)
except KeyError:

View File

@ -1973,7 +1973,7 @@ class Irc(IrcCommandDispatcher, log.Firewalled):
def do906(self, msg):
log.warning('%s: SASL authentication aborted', self.network)
self.tryNextSaslMechanism(msg)
self.tryNextSaslMechanism(msg) # TODO: should not try this in state INIT_WAITING_MOTD (set when sending CAP END because of exhausted list of SASL mechs)
def do907(self, msg):
log.warning('%s: Attempted SASL authentication when we were already '