diff options
author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-03-18 16:55:59 +0000 |
---|---|---|
committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-03-18 16:55:59 +0000 |
commit | c485e236bd7e5ea40c64b2fe54d85dbb15b2fd39 (patch) | |
tree | fc5e86abf39b69181b2084f5c39038f1811b6b44 /django/core/files/uploadhandler.py | |
parent | ee2f04d79e5bca55637b9bb3301618738a4e342a (diff) | |
download | django-c485e236bd7e5ea40c64b2fe54d85dbb15b2fd39.tar.gz |
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
Diffstat (limited to 'django/core/files/uploadhandler.py')
-rw-r--r-- | django/core/files/uploadhandler.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/core/files/uploadhandler.py b/django/core/files/uploadhandler.py index b93ff9446e..6a0eebe43e 100644 --- a/django/core/files/uploadhandler.py +++ b/django/core/files/uploadhandler.py @@ -10,6 +10,7 @@ except ImportError: from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.files.uploadedfile import TemporaryUploadedFile, InMemoryUploadedFile +from django.utils import importlib __all__ = ['UploadFileException','StopUpload', 'SkipFile', 'FileUploadHandler', 'TemporaryFileUploadHandler', 'MemoryFileUploadHandler', @@ -201,7 +202,7 @@ def load_handler(path, *args, **kwargs): i = path.rfind('.') module, attr = path[:i], path[i+1:] try: - mod = __import__(module, {}, {}, [attr]) + mod = importlib.import_module(module) except ImportError, e: raise ImproperlyConfigured('Error importing upload handler module %s: "%s"' % (module, e)) except ValueError, e: |