diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2012-02-01 11:36:16 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2012-02-01 11:36:16 -0500 |
commit | 82dabc7c76fb27898bfa864ecc8f8558949269c3 (patch) | |
tree | 879fe338f80c55a581c26a9481ebd7159bf32409 /bs4/element.py | |
parent | cb5b71d9d90f6d3fb70eb9fca297d4e12dda3a3f (diff) |
Generators no longer yield None after going off the end of the iteration.
Diffstat (limited to 'bs4/element.py')
-rw-r--r-- | bs4/element.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/bs4/element.py b/bs4/element.py index 5cadfc9..75d5d9d 100644 --- a/bs4/element.py +++ b/bs4/element.py @@ -302,38 +302,38 @@ class PageElement(object): #NavigableStrings and Tags. @property def next_elements(self): - i = self + i = self.next_element while i is not None: - i = i.next_element yield i + i = i.next_element @property def next_siblings(self): - i = self + i = self.next_sibling while i is not None: - i = i.next_sibling yield i + i = i.next_sibling @property def previous_elements(self): - i = self + i = self.previous_element while i is not None: - i = i.previous_element yield i + i = i.previous_element @property def previous_siblings(self): - i = self + i = self.previous_sibling while i is not None: - i = i.previous_sibling yield i + i = i.previous_sibling @property def parents(self): - i = self + i = self.parent while i is not None: - i = i.parent yield i + i = i.parent # Old non-property versions of the generators, for backwards # compatibility with BS3. |