Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use __iter__ rather than the inefficient nested for loops

  • Loading branch information...
commit 5cd116d078ca885f81c89390d1e5ebe8cd7f5068 1 parent 5ce2568
@legoktm legoktm authored
Showing with 2 additions and 5 deletions.
  1. +2 −5 requests/utils.py
View
7 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
Please sign in to comment.
Something went wrong with that request. Please try again.