diff --git a/django/utils/unittest/__init__.py b/django/utils/unittest/__init__.py index c38b5c50c7..ac852a3757 100644 --- a/django/utils/unittest/__init__.py +++ b/django/utils/unittest/__init__.py @@ -30,14 +30,14 @@ import sys # Django hackery to load the appropriate version of unittest -if sys.version_info >= (2,7): - # unittest2 features are native in Python 2.7 - from unittest import * -else: - try: - # check the system path first - from unittest2 import * - except ImportError: +try: + # check the system path first + from unittest2 import * +except ImportError: + if sys.version_info >= (2,7): + # unittest2 features are native in Python 2.7 + from unittest import * + else: # otherwise use our bundled version __all__ = ['TestResult', 'TestCase', 'TestSuite', 'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main',