Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit f657079c701b56e169142c8b89f9a578972cf11b 1 parent 8cb4bf5
Russell Keith-Magee authored October 18, 2010

Showing 1 changed file with 8 additions and 8 deletions. Show diff stats Hide diff stats

  1. 16  django/utils/unittest/__init__.py
16  django/utils/unittest/__init__.py
@@ -30,14 +30,14 @@
30 30
 
31 31
 # Django hackery to load the appropriate version of unittest
32 32
 
33  
-if sys.version_info >= (2,7):
34  
-    # unittest2 features are native in Python 2.7
35  
-    from unittest import *
36  
-else:
37  
-    try:
38  
-        # check the system path first
39  
-        from unittest2 import *
40  
-    except ImportError:
  33
+try:
  34
+    # check the system path first
  35
+    from unittest2 import *
  36
+except ImportError:
  37
+    if sys.version_info >= (2,7):
  38
+        # unittest2 features are native in Python 2.7
  39
+        from unittest import *
  40
+    else:
41 41
         # otherwise use our bundled version
42 42
         __all__ = ['TestResult', 'TestCase', 'TestSuite',
43 43
                    'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main',

0 notes on commit f657079

Please sign in to comment.
Something went wrong with that request. Please try again.