mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-26 12:43:09 +01:00
split_hostmask: raise an error on empty nick/ident/host
This commit is contained in:
parent
fe4bea2948
commit
899443d2fe
2
utils.py
2
utils.py
@ -93,6 +93,8 @@ def split_hostmask(mask):
|
|||||||
"""
|
"""
|
||||||
nick, identhost = mask.split('!', 1)
|
nick, identhost = mask.split('!', 1)
|
||||||
ident, host = identhost.split('@', 1)
|
ident, host = identhost.split('@', 1)
|
||||||
|
if not all({nick, ident, host}):
|
||||||
|
raise ValueError("Invalid user@host %r" % mask)
|
||||||
return [nick, ident, host]
|
return [nick, ident, host]
|
||||||
splitHostmask = split_hostmask
|
splitHostmask = split_hostmask
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user