From 6157f02067b0053da77c6537801fa48b2edf9319 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Tue, 11 May 2021 10:49:45 +0100 Subject: [PATCH] Revert "improve efficiency of _glob_to_re" This reverts commit edac710bc0c4dc1cd226d9ffe73a00b42c2b67d8. --- synapse/push/push_rule_evaluator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/synapse/push/push_rule_evaluator.py b/synapse/push/push_rule_evaluator.py index ae077af5b5..49ecb38522 100644 --- a/synapse/push/push_rule_evaluator.py +++ b/synapse/push/push_rule_evaluator.py @@ -230,8 +230,7 @@ def _glob_to_re(glob: str, word_boundary: bool) -> Pattern: if IS_GLOB.search(glob): r = re.escape(glob) - # replace 1 or more repeats of `\*` with `.*?` - r = re.sub(r"(\\\*)+", ".*?", r) + r = r.replace(r"\*", ".*?") r = r.replace(r"\?", ".") # handle [abc], [a-z] and [!a-z] style ranges.