Skip to content

Commit

Permalink
Merge pull request #3953 from user12986714/patch-29
Browse files Browse the repository at this point in the history
Use raw string for anchoring
-autopull
  • Loading branch information
makyen committed Jun 7, 2020
2 parents 333f5b5 + f7d3dda commit eee2780
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gitmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
def _anchor(str_to_anchor, blacklist_type):
""" Anchor a string according to the operation. """
if blacklist_type in {Blacklist.WATCHED_KEYWORDS, Blacklist.KEYWORDS}:
return "(?s:\b" + str_to_anchor + "\b)"
return r"(?s:\b" + str_to_anchor + r"\b)"
else:
return str_to_anchor

Expand Down Expand Up @@ -171,8 +171,8 @@ def add_to_blacklist(cls, blacklist='', item_to_blacklist='', username='', chat_
".\n"
"<!-- METASMOKE-BLACKLIST-{8} {4} -->".format(
username, chat_profile_link, op, blacklist, # 0 1 2 3
_anchor(item, blacklist_type), ms_search_option, # 4 5
quote_plus(item), # 6
item, ms_search_option, # 4 5
quote_plus(_anchor(item, blacklist_type)), # 6
quote_plus(item.replace("\\W", " ").replace("\\.", ".")), # 7
blacklist.upper()), # 8
"head": branch,
Expand Down

0 comments on commit eee2780

Please sign in to comment.