Skip to content
Myr

except clause fix for python3

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 a16278e · Browse files · 1 file+4 added−4 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+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:requests/core.py+4 added-4 removed
139 unmodified lines
140 if self.method.lower() == 'get':141 self.response.content = resp.read()142143 success = True144 except urllib2.HTTPError, why:144 except urllib2.HTTPError as why:145 self.response.status_code = why.code146147148 elif self.method == 'PUT':
15 unmodified lines
164 self.response.content = resp.read()165166 success = True167168 except urllib2.HTTPError, why:168 except urllib2.HTTPError as why:169 self.response.status_code = why.code170171172 elif self.method == 'POST':
29 unmodified lines
202 self.response.content = resp.read()203204 success = True205206 except(urllib2.HTTPError, why):206 except urllib2.HTTPError as why:207 self.response.status_code = why.code208209 210 self.sent = True if success else False
13 unmodified lines
224 self.headers = dict()225 226 def __repr__(self):227 return '<Response [%s]>' % (self.status_code)228 228229230 231class AuthObject(object):232 """The :class:`AuthObject` is a simple HTTP Authentication token. When233 given to a Requests function, it enables Basic HTTP Authentication for that
181 unmodified lines