From 0b0b496b4939e8496041a86ca13a35020138eca9 Mon Sep 17 00:00:00 2001 From: Nicolas Coevoet Date: Fri, 25 Jun 2021 17:53:04 +0000 Subject: [PATCH] fix cidr bans ValueError --- plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.py b/plugin.py index 9a35744..bbb1b11 100644 --- a/plugin.py +++ b/plugin.py @@ -138,12 +138,12 @@ def matchHostmask(pattern, n, resolve): n.ip = cache[n.prefix] = host.split('ip.')[1] if n.ip != None and '@' in pattern and n.ip.find('*') == -1 and mcidr.match(pattern.split('@')[1]): address = IPAddress('%s' % n.ip) - network = IPNetwork('%s' % pattern.split('@')[1], strict=False) + network = IPNetwork(u'%s' % pattern.split('@')[1], strict=False) if address in network: return '%s!%s@%s' % (nick, ident, n.ip) elif n.ip != None and '@' in pattern and n.ip.find('*') == -1 and m6cidr.match(pattern.split('@')[1]): address = IPAddress('%s' % n.ip) - network = IPNetwork('%s' % pattern.split('@')[1], strict=False) + network = IPNetwork(u'%s' % pattern.split('@')[1], strict=False) if address in network: return '%s!%s@%s' % (nick, ident, n.ip) if ircutils.isUserHostmask(pattern):