diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-10-18 16:01:11 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-10-18 16:01:11 +0000 |
| commit | f657079c701b56e169142c8b89f9a578972cf11b (patch) | |
| tree | 2d308ce601331f7414a4d9034e77af483a83c570 | |
| parent | 8cb4bf5ef8418c8e76dacf40cc83eb0566d5bf56 (diff) | |
Fixed #14486 -- Modified the import order for the bundled unittest so that a locally installed unittest2 (which will have more features) will supersede the Python 2.7 native version. Thanks to Michael Foord for the suggestion.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14259 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/utils/unittest/__init__.py | 16 |
1 files changed, 8 insertions, 8 deletions
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', |
