[utils] change extract_attributes to work in python 2

This commit is contained in:
remitamine 2015-10-31 19:36:04 +01:00
parent c01e1a96aa
commit 9550ca506f
2 changed files with 3 additions and 3 deletions

View file

@ -252,7 +252,8 @@ def extract_attributes(attributes_str, attributes_regex=r'(?s)\s*([^\s=]+)\s*=\s
attributes = re.findall(attributes_regex, attributes_str)
attributes_dict = {}
if attributes:
attributes_dict = {attribute_name: attribute_value for (attribute_name, attribute_value) in attributes}
for (attribute_name, attribute_value) in attributes:
attributes_dict[attribute_name] = attribute_value
return attributes_dict