Skip to content
Myr

Override __contains__ method of RequestsCookieJar to catch CookieConflictError. Refs #3028

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Casey Davidson · committed by Casey Davidson · parent 1185d65 · Browse files · 1 file+6 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−0 removed

  • other:+6 added−0 removed

1 file+6 added−0 removed

modified:requests/cookies.py+6 added
275 unmodified lines
276 or cookie.path == path):277 dictionary[cookie.name] = cookie.value278 return dictionary279280 def __contains__(self, name):281 try:282 return super(RequestsCookieJar, self).__contains__(name)283 except CookieConflictError:284 return True285286 def __getitem__(self, name):287 """Dict-like __getitem__() for compatibility with client code. Throws288 exception if there are more than one cookie with name. In that case,289 use the more explicit get() method instead.
204 unmodified lines