Index: django/test/simple.py
===================================================================
--- django/test/simple.py	(revision 3946)
+++ django/test/simple.py	(working copy)
@@ -28,7 +28,7 @@
     # models module
     try:
         app_path = app_module.__name__.split('.')[:-1]
-        test_module = __import__('.'.join(app_path + [TEST_MODULE]), [], [], TEST_MODULE)
+        test_module = __import__('.'.join(app_path + [TEST_MODULE]), {}, {}, TEST_MODULE)
         
         suite.addTest(unittest.defaultTestLoader.loadTestsFromModule(test_module))
         try:            
Index: django/db/models/loading.py
===================================================================
--- django/db/models/loading.py	(revision 3946)
+++ django/db/models/loading.py	(working copy)
@@ -48,7 +48,7 @@
 def load_app(app_name):
     "Loads the app with the provided fully qualified name, and returns the model module."
     global _app_list
-    mod = __import__(app_name, '', '', ['models'])
+    mod = __import__(app_name, {}, {}, ['models'])
     if not hasattr(mod, 'models'):
         return None
     if mod.models not in _app_list:
Index: django/db/__init__.py
===================================================================
--- django/db/__init__.py	(revision 3946)
+++ django/db/__init__.py	(working copy)
@@ -8,7 +8,7 @@
     settings.DATABASE_ENGINE = 'dummy'
 
 try:
-    backend = __import__('django.db.backends.%s.base' % settings.DATABASE_ENGINE, '', '', [''])
+    backend = __import__('django.db.backends.%s.base' % settings.DATABASE_ENGINE, {}, {}, [''])
 except ImportError, e:
     # The database backend wasn't found. Display a helpful error message
     # listing all possible database backends.
@@ -23,9 +23,9 @@
     else:
         raise # If there's some other error, this must be an error in Django itself.
 
-get_introspection_module = lambda: __import__('django.db.backends.%s.introspection' % settings.DATABASE_ENGINE, '', '', [''])
-get_creation_module = lambda: __import__('django.db.backends.%s.creation' % settings.DATABASE_ENGINE, '', '', [''])
-runshell = lambda: __import__('django.db.backends.%s.client' % settings.DATABASE_ENGINE, '', '', ['']).runshell()
+get_introspection_module = lambda: __import__('django.db.backends.%s.introspection' % settings.DATABASE_ENGINE, {}, {}, [''])
+get_creation_module = lambda: __import__('django.db.backends.%s.creation' % settings.DATABASE_ENGINE, {}, {}, [''])
+runshell = lambda: __import__('django.db.backends.%s.client' % settings.DATABASE_ENGINE, {}, {}, ['']).runshell()
 
 connection = backend.DatabaseWrapper()
 DatabaseError = backend.DatabaseError
Index: django/conf/__init__.py
===================================================================
--- django/conf/__init__.py	(revision 3946)
+++ django/conf/__init__.py	(working copy)
@@ -77,7 +77,7 @@
         self.SETTINGS_MODULE = settings_module
 
         try:
-            mod = __import__(self.SETTINGS_MODULE, '', '', [''])
+            mod = __import__(self.SETTINGS_MODULE, {}, {}, [''])
         except ImportError, e:
             raise EnvironmentError, "Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)
 
@@ -97,7 +97,7 @@
         new_installed_apps = []
         for app in self.INSTALLED_APPS:
             if app.endswith('.*'):
-                appdir = os.path.dirname(__import__(app[:-2], '', '', ['']).__file__)
+                appdir = os.path.dirname(__import__(app[:-2], {}, {}, ['']).__file__)
                 for d in os.listdir(appdir):
                     if d.isalpha() and os.path.isdir(os.path.join(appdir, d)):
                         new_installed_apps.append('%s.%s' % (app[:-2], d))
Index: django/core/serializers/__init__.py
===================================================================
--- django/core/serializers/__init__.py	(revision 3946)
+++ django/core/serializers/__init__.py	(working copy)
@@ -29,7 +29,7 @@
         
 def register_serializer(format, serializer_module):
     """Register a new serializer by passing in a module name."""
-    module = __import__(serializer_module, '', '', [''])
+    module = __import__(serializer_module, {}, {}, [''])
     _serializers[format] = module
     
 def unregister_serializer(format):
Index: django/core/urlresolvers.py
===================================================================
--- django/core/urlresolvers.py	(revision 3946)
+++ django/core/urlresolvers.py	(working copy)
@@ -119,7 +119,7 @@
             return self._callback
         mod_name, func_name = get_mod_func(self._callback_str)
         try:
-            self._callback = getattr(__import__(mod_name, '', '', ['']), func_name)
+            self._callback = getattr(__import__(mod_name, {}, {}, ['']), func_name)
         except ImportError, e:
             raise ViewDoesNotExist, "Could not import %s. Error was: %s" % (mod_name, str(e))
         except AttributeError, e:
@@ -130,7 +130,7 @@
     def reverse(self, viewname, *args, **kwargs):
         mod_name, func_name = get_mod_func(viewname)
         try:
-            lookup_view = getattr(__import__(mod_name, '', '', ['']), func_name)
+            lookup_view = getattr(__import__(mod_name, {}, {}, ['']), func_name)
         except (ImportError, AttributeError):
             raise NoReverseMatch
         if lookup_view != self.callback:
@@ -171,7 +171,7 @@
             return self._urlconf_module
         except AttributeError:
             try:
-                self._urlconf_module = __import__(self.urlconf_name, '', '', [''])
+                self._urlconf_module = __import__(self.urlconf_name, {}, {}, [''])
             except ValueError, e:
                 # Invalid urlconf_name, such as "foo.bar." (note trailing period)
                 raise ImproperlyConfigured, "Error while importing URLconf %r: %s" % (self.urlconf_name, e)
@@ -186,7 +186,7 @@
         callback = getattr(self.urlconf_module, 'handler%s' % view_type)
         mod_name, func_name = get_mod_func(callback)
         try:
-            return getattr(__import__(mod_name, '', '', ['']), func_name), {}
+            return getattr(__import__(mod_name, {}, {}, ['']), func_name), {}
         except (ImportError, AttributeError), e:
             raise ViewDoesNotExist, "Tried %s. Error was: %s" % (callback, str(e))
 
@@ -200,7 +200,7 @@
         if not callable(lookup_view):
             mod_name, func_name = get_mod_func(lookup_view)
             try:
-                lookup_view = getattr(__import__(mod_name, '', '', ['']), func_name)
+                lookup_view = getattr(__import__(mod_name, {}, {}, ['']), func_name)
             except (ImportError, AttributeError):
                 raise NoReverseMatch
         for pattern in self.urlconf_module.urlpatterns:
Index: django/core/handlers/base.py
===================================================================
--- django/core/handlers/base.py	(revision 3946)
+++ django/core/handlers/base.py	(working copy)
@@ -26,7 +26,7 @@
                 raise exceptions.ImproperlyConfigured, '%s isn\'t a middleware module' % middleware_path
             mw_module, mw_classname = middleware_path[:dot], middleware_path[dot+1:]
             try:
-                mod = __import__(mw_module, '', '', [''])
+                mod = __import__(mw_module, {}, {}, [''])
             except ImportError, e:
                 raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e)
             try:
Index: django/core/cache/__init__.py
===================================================================
--- django/core/cache/__init__.py	(revision 3946)
+++ django/core/cache/__init__.py	(working copy)
@@ -48,7 +48,7 @@
     if host.endswith('/'):
         host = host[:-1]
 
-    cache_class = getattr(__import__('django.core.cache.backends.%s' % BACKENDS[scheme], '', '', ['']), 'CacheClass')
+    cache_class = getattr(__import__('django.core.cache.backends.%s' % BACKENDS[scheme], {}, {}, ['']), 'CacheClass')
     return cache_class(host, params)
 
 cache = get_cache(settings.CACHE_BACKEND)
Index: django/core/management.py
===================================================================
--- django/core/management.py	(revision 3946)
+++ django/core/management.py	(working copy)
@@ -446,7 +446,7 @@
     # dispatcher events.
     for app_name in settings.INSTALLED_APPS:
         try:
-            __import__(app_name + '.management', '', '', [''])
+            __import__(app_name + '.management', {}, {}, [''])
         except ImportError:
             pass
 
@@ -1230,7 +1230,7 @@
         test_module_name = '.'.join(test_path[:-1])
     else:
         test_module_name = '.'
-    test_module = __import__(test_module_name, [],[],test_path[-1])
+    test_module = __import__(test_module_name, {}, {}, test_path[-1])
     test_runner = getattr(test_module, test_path[-1])
 
     test_runner(app_list, verbosity)
@@ -1419,7 +1419,7 @@
     project_directory = os.path.dirname(settings_mod.__file__)
     project_name = os.path.basename(project_directory)
     sys.path.append(os.path.join(project_directory, '..'))
-    project_module = __import__(project_name, '', '', [''])
+    project_module = __import__(project_name, {}, {}, [''])
     sys.path.pop()
 
     # Set DJANGO_SETTINGS_MODULE appropriately.
Index: django/templatetags/__init__.py
===================================================================
--- django/templatetags/__init__.py	(revision 3946)
+++ django/templatetags/__init__.py	(working copy)
@@ -2,6 +2,6 @@
 
 for a in settings.INSTALLED_APPS:
     try:
-        __path__.extend(__import__(a + '.templatetags', '', '', ['']).__path__)
+        __path__.extend(__import__(a + '.templatetags', {}, {}, ['']).__path__)
     except ImportError:
         pass
Index: django/views/debug.py
===================================================================
--- django/views/debug.py	(revision 3946)
+++ django/views/debug.py	(working copy)
@@ -75,7 +75,7 @@
         loader_debug_info = []
         for loader in template_source_loaders:
             try:
-                source_list_func = getattr(__import__(loader.__module__, '', '', ['get_template_sources']), 'get_template_sources')
+                source_list_func = getattr(__import__(loader.__module__, {}, {}, ['get_template_sources']), 'get_template_sources')
                 # NOTE: This assumes exc_value is the name of the template that
                 # the loader attempted to load.
                 template_list = [{'name': t, 'exists': os.path.exists(t)} \ 
Index: django/contrib/auth/__init__.py
===================================================================
--- django/contrib/auth/__init__.py	(revision 3946)
+++ django/contrib/auth/__init__.py	(working copy)
@@ -9,7 +9,7 @@
     i = path.rfind('.')
     module, attr = path[:i], path[i+1:]
     try:
-        mod = __import__(module, '', '', [attr])
+        mod = __import__(module, {}, {}, [attr])
     except ImportError, e:
         raise ImproperlyConfigured, 'Error importing authentication backend %s: "%s"' % (module, e)
     try:
Index: django/contrib/admin/views/template.py
===================================================================
--- django/contrib/admin/views/template.py	(revision 3946)
+++ django/contrib/admin/views/template.py	(working copy)
@@ -14,7 +14,7 @@
     # get a dict of {site_id : settings_module} for the validator
     settings_modules = {}
     for mod in settings.ADMIN_FOR:
-        settings_module = __import__(mod, '', '', [''])
+        settings_module = __import__(mod, {}, {}, [''])
         settings_modules[settings_module.SITE_ID] = settings_module
     manipulator = TemplateValidator(settings_modules)
     new_data, errors = {}, {}
Index: django/contrib/admin/views/doc.py
===================================================================
--- django/contrib/admin/views/doc.py	(revision 3946)
+++ django/contrib/admin/views/doc.py	(working copy)
@@ -98,13 +98,13 @@
         return missing_docutils_page(request)
 
     if settings.ADMIN_FOR:
-        settings_modules = [__import__(m, '', '', ['']) for m in settings.ADMIN_FOR]
+        settings_modules = [__import__(m, {}, {}, ['']) for m in settings.ADMIN_FOR]
     else:
         settings_modules = [settings]
 
     views = []
     for settings_mod in settings_modules:
-        urlconf = __import__(settings_mod.ROOT_URLCONF, '', '', [''])
+        urlconf = __import__(settings_mod.ROOT_URLCONF, {}, {}, [''])
         view_functions = extract_views_from_urlpatterns(urlconf.urlpatterns)
         if Site._meta.installed:
             site_obj = Site.objects.get(pk=settings_mod.SITE_ID)
@@ -127,7 +127,7 @@
 
     mod, func = urlresolvers.get_mod_func(view)
     try:
-        view_func = getattr(__import__(mod, '', '', ['']), func)
+        view_func = getattr(__import__(mod, {}, {}, ['']), func)
     except (ImportError, AttributeError):
         raise Http404
     title, body, metadata = utils.parse_docstring(view_func.__doc__)
@@ -235,7 +235,7 @@
 def template_detail(request, template):
     templates = []
     for site_settings_module in settings.ADMIN_FOR:
-        settings_mod = __import__(site_settings_module, '', '', [''])
+        settings_mod = __import__(site_settings_module, {}, {}, [''])
         if Site._meta.installed:
             site_obj = Site.objects.get(pk=settings_mod.SITE_ID)
         else:
Index: django/template/__init__.py
===================================================================
--- django/template/__init__.py	(revision 3946)
+++ django/template/__init__.py	(working copy)
@@ -883,7 +883,7 @@
     lib = libraries.get(module_name, None)
     if not lib:
         try:
-            mod = __import__(module_name, '', '', [''])
+            mod = __import__(module_name, {}, {}, [''])
         except ImportError, e:
             raise InvalidTemplateLibrary, "Could not load template library from %s, %s" % (module_name, e)
         try:
Index: django/template/loaders/app_directories.py
===================================================================
--- django/template/loaders/app_directories.py	(revision 3946)
+++ django/template/loaders/app_directories.py	(working copy)
@@ -15,9 +15,9 @@
         m, a = app[:i], app[i+1:]
     try:
         if a is None:
-            mod = __import__(m, '', '', [])
+            mod = __import__(m, {}, {}, [])
         else:
-            mod = getattr(__import__(m, '', '', [a]), a)
+            mod = getattr(__import__(m, {}, {}, [a]), a)
     except ImportError, e:
         raise ImproperlyConfigured, 'ImportError %s: %s' % (app, e.args[0])
     template_dir = os.path.join(os.path.dirname(mod.__file__), 'templates')
Index: django/template/context.py
===================================================================
--- django/template/context.py	(revision 3946)
+++ django/template/context.py	(working copy)
@@ -69,7 +69,7 @@
             i = path.rfind('.')
             module, attr = path[:i], path[i+1:]
             try:
-                mod = __import__(module, '', '', [attr])
+                mod = __import__(module, {}, {}, [attr])
             except ImportError, e:
                 raise ImproperlyConfigured, 'Error importing request processor module %s: "%s"' % (module, e)
             try:
