mirror of https://github.com/django/django.git
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
This commit is contained in:
parent
8cb4bf5ef8
commit
f657079c70
|
@ -30,14 +30,14 @@ import sys
|
||||||
|
|
||||||
# Django hackery to load the appropriate version of unittest
|
# Django hackery to load the appropriate version of unittest
|
||||||
|
|
||||||
if sys.version_info >= (2,7):
|
try:
|
||||||
# unittest2 features are native in Python 2.7
|
# check the system path first
|
||||||
from unittest import *
|
from unittest2 import *
|
||||||
else:
|
except ImportError:
|
||||||
try:
|
if sys.version_info >= (2,7):
|
||||||
# check the system path first
|
# unittest2 features are native in Python 2.7
|
||||||
from unittest2 import *
|
from unittest import *
|
||||||
except ImportError:
|
else:
|
||||||
# otherwise use our bundled version
|
# otherwise use our bundled version
|
||||||
__all__ = ['TestResult', 'TestCase', 'TestSuite',
|
__all__ = ['TestResult', 'TestCase', 'TestSuite',
|
||||||
'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main',
|
'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main',
|
||||||
|
|
Loading…
Reference in New Issue