Created
March 17, 2016 06:48
-
-
Save boykov/42a71c477d2a0d84a31c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/orgparse/node.py b/orgparse/node.py | |
index bd3afc3..2efa507 100644 | |
--- a/orgparse/node.py | |
+++ b/orgparse/node.py | |
@@ -374,7 +374,10 @@ class OrgBaseNode(Sequence): | |
def __iter__(self): | |
yield self | |
level = self.level | |
+ nsl = self.next_same_level | |
for node in self.env._nodes[self._index + 1:]: | |
+ if node == nsl: | |
+ break | |
if node.level > level: | |
yield node | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment