From c485e236bd7e5ea40c64b2fe54d85dbb15b2fd39 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Wed, 18 Mar 2009 16:55:59 +0000 Subject: Fixed #8193: all dynamic imports in Django are now done correctly. I know this because Brett Cannon borrowed the time machine and brought Python 2.7's '`importlib` back for inclusion in Django. Thanks for the patch-from-the-future, Brett! git-svn-id: http://code.djangoproject.com/svn/django/trunk@10088 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/auth/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'django/contrib/auth') diff --git a/django/contrib/auth/__init__.py b/django/contrib/auth/__init__.py index 87c2bc1b50..b89aee1682 100644 --- a/django/contrib/auth/__init__.py +++ b/django/contrib/auth/__init__.py @@ -1,5 +1,6 @@ import datetime from django.core.exceptions import ImproperlyConfigured +from django.utils.importlib import import_module SESSION_KEY = '_auth_user_id' BACKEND_SESSION_KEY = '_auth_user_backend' @@ -9,7 +10,7 @@ def load_backend(path): i = path.rfind('.') module, attr = path[:i], path[i+1:] try: - mod = __import__(module, {}, {}, [attr]) + mod = import_module(module) except ImportError, e: raise ImproperlyConfigured, 'Error importing authentication backend %s: "%s"' % (module, e) except ValueError, e: -- cgit v1.3