aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar jesopo2020-01-22 15:00:59 +0000
committerGravatar jesopo2020-01-22 15:00:59 +0000
commitade5cbb1f37d06fe77d21f344d030904cc19034d (patch)
tree57fb5183321d14b0bbe321d5046a910c49e00ca0 /src
parenteffectively ignore ENDOF when there were no items (diff)
signature
add an optional mask pattern arg to !clear
Diffstat (limited to 'src')
-rw-r--r--src/utils/irc.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/irc.py b/src/utils/irc.py
index adc62a32..7194663f 100644
--- a/src/utils/irc.py
+++ b/src/utils/irc.py
@@ -287,8 +287,8 @@ def hostmask_match_many(hostmasks: typing.List[str], pattern: HostmaskPattern,
) -> typing.Optional[str]:
for hostmask in hostmasks:
if pattern.match(hostmask):
- return hostmask
+ yield hostmask
return None
def hostmask_match(hostmask: str, pattern: HostmaskPattern) -> bool:
- return not hostmask_match_many([hostmask], pattern) == None
+ return any(hostmask_match_many([hostmask], pattern))