projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[utils] change extract_attributes to work in python 2
[youtube-dl]
/
youtube_dl
/
utils.py
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index bcebf9cc5cd278a33c4df11c1feecd19d919e23a..518cea98bd52639403caaf16dc7a5137651e5e2f 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-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 = 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
return attributes_dict