From bbf41a5b4e6019c0c5fd01db928628c9d49aa7cd Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Fri, 6 Jun 2025 11:17:10 -0700 Subject: [PATCH] fix: resolve regex library warnings Signed-off-by: Emmanuel Ferdman --- discord/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/utils.py b/discord/utils.py index 5e40069224..b509162cf0 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -933,7 +933,7 @@ def replacement(match): regex = _MARKDOWN_STOCK_REGEX if ignore_links: regex = f"(?:{_URL_REGEX}|{regex})" - return re.sub(regex, replacement, text, 0, re.MULTILINE) + return re.sub(regex, replacement, text, count=0, flags=re.MULTILINE) def escape_markdown( @@ -975,7 +975,7 @@ def replacement(match): regex = _MARKDOWN_STOCK_REGEX if ignore_links: regex = f"(?:{_URL_REGEX}|{regex})" - return re.sub(regex, replacement, text, 0, re.MULTILINE | re.X) + return re.sub(regex, replacement, text, count=0, flags=re.MULTILINE | re.X) else: text = re.sub(r"\\", r"\\\\", text) return _MARKDOWN_ESCAPE_REGEX.sub(r"\\\1", text)