Skip to content

Commit

Permalink
Avoid duplicating schemes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaap Roes committed Aug 7, 2012
1 parent ffc00dd commit 9ec2594
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion raven/utils/urlparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

def register_scheme(scheme):
for method in filter(lambda s: s.startswith('uses_'), dir(_urlparse)):
getattr(_urlparse, method).append(scheme)
uses = getattr(_urlparse, method)
if scheme not in uses:
uses.append(scheme)


urlparse = _urlparse.urlparse

0 comments on commit 9ec2594

Please sign in to comment.