diff --git a/sopel/modules/url.py b/sopel/modules/url.py index 6009063edc..8bd1de4374 100644 --- a/sopel/modules/url.py +++ b/sopel/modules/url.py @@ -99,7 +99,7 @@ def trim_url(url): # clean unmatched parentheses/braces/brackets for (opener, closer) in [('(', ')'), ('[', ']'), ('{', '}'), ('<', '>')]: - if url[-1] is closer and url.count(opener) < url.count(closer): + if (url[-1] == closer) and (url.count(opener) < url.count(closer)): url = url[:-1] return url