File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -110,10 +110,9 @@ def _match_attr_name(attr, ava):
110
110
111
111
112
112
def _apply_attr_value_restrictions (attr , res , must = False ):
113
- try :
114
- values = [av ["text" ] for av in attr ["attribute_value" ]]
115
- except KeyError :
116
- values = []
113
+ values = [
114
+ av ["text" ] for av in attr .get ("attribute_value" , [])
115
+ ]
117
116
118
117
try :
119
118
res [_fn ].extend (_filter_values (ava [_fn ], values ))
Original file line number Diff line number Diff line change @@ -1379,13 +1379,15 @@ def entity_attributes(self, entity_id):
1379
1379
ext = self .__getitem__ (entity_id )["extensions" ]
1380
1380
except KeyError :
1381
1381
return res
1382
+
1382
1383
for elem in ext ["extension_elements" ]:
1383
- if elem ["__class__" ] == classnames ["mdattr_entityattributes" ]:
1384
- for attr in elem ["attribute" ]:
1385
- if attr ["name" ] not in res :
1386
- res [attr ["name" ]] = []
1387
- res [attr ["name" ]] += [v ["text" ] for v in attr [
1388
- "attribute_value" ]]
1384
+ if elem ["__class__" ] != classnames ["mdattr_entityattributes" ]:
1385
+ continue
1386
+ for attr in elem ["attribute" ]:
1387
+ res [attr ["name" ]] = [
1388
+ * res .get (attr ["name" ], []),
1389
+ * (v ["text" ] for v in attr .get ("attribute_value" , []))
1390
+ ]
1389
1391
return res
1390
1392
1391
1393
def supported_algorithms (self , entity_id ):
You can’t perform that action at this time.
0 commit comments