From 2eb32de26e8574fc03a88c5d8f4c1fc2cdbeee08 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 16 May 2020 00:32:00 +0200 Subject: [PATCH] registry: Hide warning when channel is 'global'. --- src/registry.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/registry.py b/src/registry.py index 1d1be5035..3add45df5 100644 --- a/src/registry.py +++ b/src/registry.py @@ -435,11 +435,14 @@ class Value(Group): # Also, we're setting them to None instead of raising an error in # order not to break existing plugins. if channel and not ircutils.isChannel(channel): - from . import log - log.warning( - 'Trying to get channel-specific value of %s for channel %s, ' - 'but it is not a channel. This is a bug, please report it.', - self._name, channel) + if channel != 'global': + # excluding 'global', it's a special value used for linking + # channels and by some plugins. + from . import log + log.warning( + 'Trying to get channel-specific value of %s for channel %s, ' + 'but it is not a channel. This is a bug, please report it.', + self._name, channel) channel = None if network: from . import world # put here to work around circular dependencies