|
44 | 44 |
|
45 | 45 | import os |
46 | 46 | import re |
47 | | -import sets |
| 47 | +try: |
| 48 | + from sets import Set as set # For Python 2.3 compatibility |
| 49 | +except ImportError: |
| 50 | + pass |
48 | 51 | import sys |
49 | 52 |
|
50 | 53 | import gtest_test_utils |
|
58 | 61 | # exception is thrown if the input is anything other than 'True' nor 'False'. |
59 | 62 | os.environ['EMPTY_VAR'] = '' |
60 | 63 | child = gtest_test_utils.Subprocess( |
61 | | - [sys.executable, '-c', 'import os; print \'EMPTY_VAR\' in os.environ']) |
| 64 | + [sys.executable, '-c', 'import os; print(\'EMPTY_VAR\' in os.environ)']) |
62 | 65 | CAN_PASS_EMPTY_ENV = eval(child.output) |
63 | 66 |
|
64 | 67 |
|
|
71 | 74 | os.environ['UNSET_VAR'] = 'X' |
72 | 75 | del os.environ['UNSET_VAR'] |
73 | 76 | child = gtest_test_utils.Subprocess( |
74 | | - [sys.executable, '-c', 'import os; print \'UNSET_VAR\' not in os.environ']) |
| 77 | + [sys.executable, '-c', 'import os; print(\'UNSET_VAR\' not in os.environ)']) |
75 | 78 | CAN_UNSET_ENV = eval(child.output) |
76 | 79 |
|
77 | 80 |
|
@@ -243,14 +246,14 @@ def AssertPartitionIsValid(self, set_var, list_of_sets): |
243 | 246 | for slice_var in list_of_sets: |
244 | 247 | full_partition.extend(slice_var) |
245 | 248 | self.assertEqual(len(set_var), len(full_partition)) |
246 | | - self.assertEqual(sets.Set(set_var), sets.Set(full_partition)) |
| 249 | + self.assertEqual(set(set_var), set(full_partition)) |
247 | 250 |
|
248 | 251 | def AdjustForParameterizedTests(self, tests_to_run): |
249 | 252 | """Adjust tests_to_run in case value parameterized tests are disabled.""" |
250 | 253 |
|
251 | 254 | global param_tests_present |
252 | 255 | if not param_tests_present: |
253 | | - return list(sets.Set(tests_to_run) - sets.Set(PARAM_TESTS)) |
| 256 | + return list(set(tests_to_run) - set(PARAM_TESTS)) |
254 | 257 | else: |
255 | 258 | return tests_to_run |
256 | 259 |
|
|
0 commit comments