should be using pair_start/pair_end throughout for

This commit is contained in:
jesopo 2019-09-19 13:51:27 +01:00
parent 9d846d10e2
commit b69c9146b2

View file

@ -21,8 +21,8 @@ def url_sanitise(url: str):
# google.com/()) -> google.com/()
if url.endswith(pair_end):
if pair_start in url:
open_index = url.rfind("(")
other_index = url.rfind(")", 0, len(url)-1)
open_index = url.rfind(pair_start)
other_index = url.rfind(pair_end, 0, len(url)-1)
if not other_index == -1 and other_index < open_index:
url = url[:-1]
else: