Revert changes to iterables.
parent
78a480aa08
commit
c12336b55a
|
@ -185,6 +185,7 @@ def _iterate_over_values(dict_values, tuple_to_find):
|
|||
item.get(val) == tuple_to_find[1]):
|
||||
return idx
|
||||
elif isinstance(pv, dict):
|
||||
if pv.get(tuple_to_find[0]) is not None:
|
||||
for idx, item in enumerate(sorted(pv.keys())):
|
||||
if ((item == tuple_to_find[0] and str.isdigit(item)) and
|
||||
(pv[item] == tuple_to_find[1])):
|
||||
|
@ -193,17 +194,21 @@ def _iterate_over_values(dict_values, tuple_to_find):
|
|||
return idx
|
||||
for item in pv.values():
|
||||
if isinstance(item, _STIXBase):
|
||||
return find_property_index(
|
||||
index = find_property_index(
|
||||
item,
|
||||
item.object_properties(),
|
||||
tuple_to_find
|
||||
)
|
||||
if index is not None:
|
||||
return index
|
||||
elif isinstance(item, dict):
|
||||
return find_property_index(
|
||||
index = find_property_index(
|
||||
item,
|
||||
item.keys(),
|
||||
tuple_to_find
|
||||
)
|
||||
if index is not None:
|
||||
return index
|
||||
|
||||
|
||||
def find_property_index(obj, properties, tuple_to_find):
|
||||
|
|
Loading…
Reference in New Issue