From a57a06b1cc74eec75dcc9d44f3192c263eb76b2c Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 30 Aug 2019 18:13:12 +0100 Subject: switch utils.deadline to a context manager --- modules/sed.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/sed.py b/modules/sed.py index 31e7316e..62879da0 100644 --- a/modules/sed.py +++ b/modules/sed.py @@ -55,10 +55,10 @@ class Module(ModuleManager.BaseModule): for_user = event["user"].nickname if self._closest_setting(event, "sed-sender-only", False) else None - def _find(): - return event["target"].buffer.find(pattern, from_self=False, + with utils.deadline(): + match = event["target"].buffer.find(pattern, from_self=False, for_user=for_user, not_pattern=REGEX_SED) - match = utils.deadline(_find) + if match: new_message = re.sub(pattern, replace, match.line.message, count) -- cgit v1.3.1-10-gc9f91