diff --git a/django/db/utils.py b/django/db/utils.py index e8e508bde8a..e3f36bdd03a 100644 --- a/django/db/utils.py +++ b/django/db/utils.py @@ -41,12 +41,11 @@ def load_backend(backend_name): and not f.startswith('.')] except EnvironmentError: available_backends = [] - available_backends.sort() if backend_name not in available_backends: error_msg = ("%r isn't an available database backend. \n" + "Try using django.db.backends.XXX, where XXX is one of:\n %s\n" + "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) else: raise # If there's some other error, this must be an error in Django itself.