From 833b2334bcddf019b125689a85c0d4f3bd6515fa Mon Sep 17 00:00:00 2001 From: Kevin Kubasik Date: Wed, 1 Jul 2009 10:39:06 +0000 Subject: [PATCH] [gsoc2009-testing] Use importlib from django.util in attempt_import git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/test-improvements@11136 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management/commands/test_windmill.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/django/core/management/commands/test_windmill.py b/django/core/management/commands/test_windmill.py index 27352e3438..7031431fd7 100644 --- a/django/core/management/commands/test_windmill.py +++ b/django/core/management/commands/test_windmill.py @@ -6,19 +6,19 @@ from time import sleep import types import logging import threading - +from django.utils import importlib class ServerContainer(object): start_test_server = djangotest.start_test_server stop_test_server = djangotest.stop_test_server def attempt_import(name, suffix): try: - mod = __import__(name+'.'+suffix) + mod = importlib.import_module(name+'.'+suffix) except ImportError: mod = None if mod is not None: s = name.split('.') - mod = __import__(s.pop(0)) + mod = importlib.import_module(s.pop(0)) for x in s+[suffix]: try: mod = getattr(mod, x)