Skip to content

Commit

Permalink
Changed django/db/utils.py load_backend() to call sorted() instead of…
Browse files Browse the repository at this point in the history
… .sort(). Saves us a line of code. Taken from patch for #15621

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15851 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
adrianholovaty committed Mar 16, 2011
1 parent 304a50d commit ad55bb0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions django/db/utils.py
Expand Up @@ -41,12 +41,11 @@ def load_backend(backend_name):
and not f.startswith('.')] and not f.startswith('.')]
except EnvironmentError: except EnvironmentError:
available_backends = [] available_backends = []
available_backends.sort()
if backend_name not in available_backends: if backend_name not in available_backends:
error_msg = ("%r isn't an available database backend. \n" + error_msg = ("%r isn't an available database backend. \n" +
"Try using django.db.backends.XXX, where XXX is one of:\n %s\n" + "Try using django.db.backends.XXX, where XXX is one of:\n %s\n" +
"Error was: %s") % \ "Error was: %s") % \
(backend_name, ", ".join(map(repr, available_backends)), e_user) (backend_name, ", ".join(map(repr, sorted(available_backends))), e_user)
raise ImproperlyConfigured(error_msg) raise ImproperlyConfigured(error_msg)
else: else:
raise # If there's some other error, this must be an error in Django itself. raise # If there's some other error, this must be an error in Django itself.
Expand Down

0 comments on commit ad55bb0

Please sign in to comment.