Skip to content

Commit b0d55ac

Browse files
committed
Fixes for old python versions
1 parent 4171aa2 commit b0d55ac

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

extruct/w3cmicrodata.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,16 @@ def _extract_property_refs(self, node, refid, items_seen, base_url):
130130
if 'itemprop' in ref_node.keys() and 'itemscope' in ref_node.keys():
131131
# An full item will be extracted from the node, no need to look
132132
# for individual properties in childs
133-
yield from extract_fn(ref_node)
133+
for p, v in extract_fn(ref_node):
134+
yield p, v
134135
else:
135136
base_parent_scope = ref_node.xpath("ancestor-or-self::*[@itemscope][1]")
136137
for prop in ref_node.xpath("descendant-or-self::*[@itemprop]"):
137138
parent_scope = prop.xpath("ancestor::*[@itemscope][1]")
138139
# Skip properties defined in a different scope than the ref_node
139140
if parent_scope == base_parent_scope:
140-
yield from extract_fn(prop)
141+
for p, v in extract_fn(prop):
142+
yield p, v
141143

142144
def _extract_property(self, node, items_seen, base_url):
143145
props = node.get("itemprop").split()

0 commit comments

Comments
 (0)