Skip to content

Commit

Permalink
Remove global register_schemes calls
Browse files Browse the repository at this point in the history
Modifying the global urllib.parse/urlparse uses_* variables isn't needed anymore. Most aren't used and are only left for backwards_compatibility.
Only one that could be relevant would be `uses_param` (for parsing path variables). But theses aren't used/read from the result anywhere in django-environ.
  • Loading branch information
Jorrit authored Jan 13, 2020
1 parent f0af058 commit 170880c
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions environ/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,21 +785,3 @@ def _absolute_join(base, *paths, **kwargs):
raise ImproperlyConfigured(
"Create required path: {0}".format(absolute_path))
return absolute_path


def register_scheme(scheme):
for method in dir(urlparselib):
if method.startswith('uses_'):
getattr(urlparselib, method).append(scheme)


def register_schemes(schemes):
for scheme in schemes:
register_scheme(scheme)


# Register database and cache schemes in URLs.
register_schemes(Env.DB_SCHEMES.keys())
register_schemes(Env.CACHE_SCHEMES.keys())
register_schemes(Env.SEARCH_SCHEMES.keys())
register_schemes(Env.EMAIL_SCHEMES.keys())

0 comments on commit 170880c

Please sign in to comment.