Skip to content

Commit 66f8079

Browse files
committed
Another attempt to fix sorting in python2
1 parent 54690a1 commit 66f8079

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

telegram/utils/helpers.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,5 @@ def extract_urls(message):
161161
# Strip trailing slash from URL so we can compare them for equality
162162
stripped_urls = [x[:-1] if x[-1] == '/' else x for x in all_urls]
163163

164-
sorted_urls = sorted(stripped_urls)
165-
166-
# Remove exact duplicates
167-
urls = OrderedDict({k: None for k in sorted_urls})
168-
return list(urls.keys())
164+
urls = set(stripped_urls)
165+
return sorted(list(urls))

0 commit comments

Comments
 (0)