mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
models: Avoid undocumented sre_constants module.
>>> sre_constants.error is re.error True Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import datetime
|
||||
import re
|
||||
import sre_constants
|
||||
import time
|
||||
from collections import defaultdict
|
||||
from datetime import timedelta
|
||||
@@ -718,7 +717,7 @@ def filter_pattern_validator(value: str) -> None:
|
||||
|
||||
try:
|
||||
re.compile(value)
|
||||
except sre_constants.error:
|
||||
except re.error:
|
||||
# Regex is invalid
|
||||
raise ValidationError(error_msg)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user