summaryrefslogtreecommitdiff
blob: 1b7294f226735570bd19942d0a99b61508e509d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--- test-tools/testprogram.py
+++ test-tools/testprogram.py
@@ -10,8 +10,12 @@
 import sys
 import time
 import traceback
-from unittest import defaultTestLoader, TextTestRunner, TestSuite, TestCase, \
-     _TextTestResult
+from unittest import defaultTestLoader, TextTestRunner, TestSuite, TestCase
+try:
+    # Python 2.7 and >=3.2
+    from unittest.runner import _TextTestResult
+except ImportError:
+    from unittest import _TextTestResult
 
 
 class ServerStartupError(Exception):