projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ce2568
)
Use __iter__ rather than the inefficient nested for loops
author
Kunal Mehta
<legoktm@gmail.com>
Mon, 1 Oct 2012 00:24:56 +0000
(19:24 -0500)
committer
Kunal Mehta
<legoktm@gmail.com>
Mon, 1 Oct 2012 00:24:56 +0000
(19:24 -0500)
requests/utils.py
patch
|
blob
|
history
diff --git
a/requests/utils.py
b/requests/utils.py
index
eb14600
..
63b281a
100644
(file)
--- a/
requests/utils.py
+++ b/
requests/utils.py
@@
-311,11
+311,8
@@
def dict_from_cookiejar(cj):
cookie_dict = {}
- for _, cookies in list(cj._cookies.items()):
- for _, cookies in list(cookies.items()):
- for cookie in list(cookies.values()):
- # print cookie
- cookie_dict[cookie.name] = cookie.value
+ for cookie in cj:
+ cookie_dict[cookie.name] = cookie.value
return cookie_dict