Skip to content

Commit 8e97cb5

Browse files
fix: resolve regex library warnings (#2807)
Signed-off-by: Emmanuel Ferdman <[email protected]>
1 parent f17fedd commit 8e97cb5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

discord/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ def replacement(match):
933933
regex = _MARKDOWN_STOCK_REGEX
934934
if ignore_links:
935935
regex = f"(?:{_URL_REGEX}|{regex})"
936-
return re.sub(regex, replacement, text, 0, re.MULTILINE)
936+
return re.sub(regex, replacement, text, count=0, flags=re.MULTILINE)
937937

938938

939939
def escape_markdown(
@@ -975,7 +975,7 @@ def replacement(match):
975975
regex = _MARKDOWN_STOCK_REGEX
976976
if ignore_links:
977977
regex = f"(?:{_URL_REGEX}|{regex})"
978-
return re.sub(regex, replacement, text, 0, re.MULTILINE | re.X)
978+
return re.sub(regex, replacement, text, count=0, flags=re.MULTILINE | re.X)
979979
else:
980980
text = re.sub(r"\\", r"\\\\", text)
981981
return _MARKDOWN_ESCAPE_REGEX.sub(r"\\\1", text)

0 commit comments

Comments
 (0)