diff options
Diffstat (limited to 'Lib/lib2to3/btm_utils.py')
-rw-r--r-- | Lib/lib2to3/btm_utils.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/lib2to3/btm_utils.py b/Lib/lib2to3/btm_utils.py index ff76ba3..501f834 100644 --- a/Lib/lib2to3/btm_utils.py +++ b/Lib/lib2to3/btm_utils.py @@ -96,7 +96,8 @@ class MinNode(object): def leaves(self): "Generator that returns the leaves of the tree" for child in self.children: - yield from child.leaves() + for x in child.leaves(): + yield x if not self.children: yield self @@ -276,6 +277,7 @@ def rec_test(sequence, test_func): sub-iterables""" for x in sequence: if isinstance(x, (list, tuple)): - yield from rec_test(x, test_func) + for y in rec_test(x, test_func): + yield y else: yield test_func(x) |