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:
e656222
)
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
Radu Voicilas
<radu.voicilas@gmail.com>
Mon, 8 Oct 2012 21:42:48 +0000
(
00:42
+0300)
requests/utils.py
patch
|
blob
|
history
diff --git
a/requests/utils.py
b/requests/utils.py
index eb1460002d9566eada2a58beebd1f5b8a177f884..63b281a25ccf66a71fc08adeee75bdb205220ddf 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