diff options
author | Waylan Limberg <waylan.limberg@icloud.com> | 2018-01-04 14:24:30 -0500 |
---|---|---|
committer | Waylan Limberg <waylan.limberg@icloud.com> | 2018-01-04 14:47:58 -0500 |
commit | bbada79726d900ef9ae5410ab3a0ce573a742c00 (patch) | |
tree | 4d8f9ae5ee7fb8dbc7ae4d4fa96c4b102604c006 /markdown/treeprocessors.py | |
parent | a7d211b53afbdb3c3febf881127dfbea4da422ee (diff) | |
download | python-markdown-bbada79726d900ef9ae5410ab3a0ce573a742c00.tar.gz |
Avoid DeprecationWarnings for etree
Fixes #618.
Diffstat (limited to 'markdown/treeprocessors.py')
-rw-r--r-- | markdown/treeprocessors.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/markdown/treeprocessors.py b/markdown/treeprocessors.py index f159a8a..8feea8d 100644 --- a/markdown/treeprocessors.py +++ b/markdown/treeprocessors.py @@ -272,8 +272,8 @@ class InlineProcessor(Treeprocessor): def __build_ancestors(self, parent, parents): """Build the ancestor list.""" ancestors = [] - while parent: - if parent: + while parent is not None: + if parent is not None: ancestors.append(parent.tag.lower()) parent = self.parent_map.get(parent) ancestors.reverse() @@ -303,7 +303,7 @@ class InlineProcessor(Treeprocessor): # to ensure we don't have the user accidentally change it on us. tree_parents = [] if ancestors is None else ancestors[:] - self.parent_map = dict((c, p) for p in tree.getiterator() for c in p) + self.parent_map = dict((c, p) for p in tree.iter() for c in p) stack = [(tree, tree_parents)] while stack: |