Skip to content

Commit

Permalink
Merge pull request #1517 from sopel-irc/dgw/py2-trim_url-fix
Browse files Browse the repository at this point in the history
url: Fix py2 compatibility in trim_url()
  • Loading branch information
dgw authored Mar 24, 2019
2 parents 7f68cac + fa42aef commit 5cdc607
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sopel/modules/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5cdc607

Please sign in to comment.