Skip to content

Commit 3e28019

Browse files
committed
Supporting Python 2.6
1 parent cb971c9 commit 3e28019

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

source_py2/python_toolbox/emitting/emitter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ def _get_callable_outputs(self):
246246

247247
def _get_emitter_outputs(self):
248248
'''Get the direct emitter outputs of this emitter.'''
249-
return {output for output in self._outputs if isinstance(output, Emitter)}
249+
return set((output for output in self._outputs
250+
if isinstance(output, Emitter)))
250251

251252
def get_total_callable_outputs(self):
252253
'''

source_py2/test_python_toolbox/test_caching/test_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_unhashable_arguments():
114114

115115
f = cache()(counting_func)
116116

117-
x = {1, 2}
117+
x = set((1, 2))
118118

119119
assert f(x) == f(x)
120120

source_py2/test_python_toolbox/test_nifty_collections/test_various_ordered_sets.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ def test_operations(self):
2121

2222
def test_bool(self):
2323
assert bool(self.ordered_set_type({})) is False
24-
assert bool(self.ordered_set_type({0})) is True
24+
assert bool(self.ordered_set_type(set((0,)))) is True
2525
assert bool(self.ordered_set_type(range(5))) is True
2626

2727

2828
class BaseMutableOrderedSetTestCase(BaseOrderedSetTestCase):
2929
__test__ = False
3030
def test_sort(self):
3131
ordered_set = self.ordered_set_type([5, 61, 2, 7, 2])
32-
assert ordered_set != {5, 61, 2, 7}
32+
assert ordered_set != set((5, 61, 2, 7))
3333
ordered_set.move_to_end(61)
3434
assert list(ordered_set) == [5, 2, 7, 61]
3535
ordered_set.sort()
@@ -103,10 +103,10 @@ def test_hashable(self):
103103
FrozenOrderedSet(range(3)): 3,
104104
}
105105
assert len(d) == 3
106-
assert set(d.values()) == {1, 2, 3}
106+
assert set(d.values()) == set((1, 2, 3))
107107
assert d[FrozenOrderedSet(range(2))] == 2
108108
d[FrozenOrderedSet(range(2))] = 20
109-
assert set(d.values()) == {1, 20, 3}
109+
assert set(d.values()) == set((1, 20, 3))
110110

111111

112112
class EmittingOrderedSetTestCase(BaseMutableOrderedSetTestCase):

source_py2/test_python_toolbox/test_pickle_tools/test_compressing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
my_messy_object = (
1717
'Whatever',
1818
{1: 2,},
19-
{3, 4},
19+
set((3, 4)),
2020
frozenset([3, 4]),
2121
((((((((((((())))))))))))),
2222
u'unicode_too',

0 commit comments

Comments
 (0)