Skip to content
Myr

fixed gevent problem

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parent b09218d · Browse files · 1 file+17 added−13 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+17 added−13 removed

  • other:+17 added−13 removed

1 file+17 added−13 removed

modified:requests/core.py+17 added-13 removed
101 unmodified lines
102 """Creates appropriate opener object for urllib2."""103104 _handlers = []105106 if self.auth:107 108 authr = urllib2.HTTPPasswordMgrWithDefaultRealm()106 if self.auth or self.cookiejar:107110 authr.add_password(None, self.url, self.auth.username, self.auth.password)111 auth_handler = urllib2.HTTPBasicAuthHandler(authr)108 if self.auth:109113 _handlers.append(auth_handler)110 authr = urllib2.HTTPPasswordMgrWithDefaultRealm()111115 if self.cookiejar:116 117 cookie_handler = urllib2.HTTPCookieProcessor(cookiejar)118 _handlers.append(cookie_handler)112 authr.add_password(None, self.url, self.auth.username, self.auth.password)113 auth_handler = urllib2.HTTPBasicAuthHandler(authr)114120 121 opener = urllib2.build_opener(*_handlers)122 return opener.open115 _handlers.append(auth_handler)116117 if self.cookiejar:118119 cookie_handler = urllib2.HTTPCookieProcessor(cookiejar)120 _handlers.append(cookie_handler)121122 opener = urllib2.build_opener(*_handlers)123 return opener.open124125 else:126 return urllib2.urlopen127128129 def _build_response(self, resp):130 """Build internal Response object from given response."""131 132 self.response.status_code = resp.code
319 unmodified lines