jenkins-bot has submitted this change and it was merged.
Change subject: Make sure unittest2 is only used on Python 2.6 ......................................................................
Make sure unittest2 is only used on Python 2.6
Change-Id: I4fe7e3497d91bf3b5d53d649040490d02bc5613b --- M tests/utils.py 1 file changed, 3 insertions(+), 8 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/utils.py b/tests/utils.py index f767538..ddaaf9e 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -9,16 +9,11 @@ # import time import sys -try: + +if sys.version_info < (2, 7): # Unittest2 is a backport of python 2.7s unittest module to python 2.6 - # Trying to import unittest2 has to happen first because 2.6 does have a - # unittest module in the standard library but that doesn't support all the - # features of the one found in python 2.7, so importing unittest first and - # then trying to figure out if it supports the features used would mean - # checking the module contents etc. Just catching an ImportError once is - # much easier. import unittest2 as unittest -except ImportError: +else: import unittest
import pywikibot
pywikibot-commits@lists.wikimedia.org