PEP8 Cleanup
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Idan Gazit · committed by Idan Gazit · parent a189c23 · Browse files · 1 file·+6 added−10 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−10 removed
- other:+6 added−10 removed
Provenance
- Commit
d240b1f- Tree
48abcf4- Author
Idan Gazit <idan@gazit.me>- Committer
Idan Gazit <idan@gazit.me>- Parent
a189c23
1 file changed+6 added−10 removed
modified:requests/models.py+6 added-10 removed
107 unmodified lines108 109 # If no proxies are given, allow configuration by environment variables110 # HTTP_PROXY and HTTPS_PROXY.111 if not self.proxies and self.config.get('trust_env'):112- if 'HTTP_PROXY' in os.environ:113- self.proxies['http'] = os.environ['HTTP_PROXY']114- if 'HTTPS_PROXY' in os.environ:115- self.proxies['https'] = os.environ['HTTPS_PROXY']112+ if 'HTTP_PROXY' in os.environ:113+ self.proxies['http'] = os.environ['HTTP_PROXY']114+ if 'HTTPS_PROXY' in os.environ:115+ self.proxies['https'] = os.environ['HTTPS_PROXY']116 117 self.data, self._enc_data = self._encode_params(data)118 self.params, self._enc_params = self._encode_params(params)119 self.files, self._enc_files = self._encode_files(files)223 unmodified lines343 return result, urlencode(result, doseq=True)344 else:345 return data, data346 347- def _encode_files(self,files):347+ def _encode_files(self, files):348 349 if (not files) or isinstance(self.data, str):350 return None, None351 37 unmodified lines389 390 if not path:391 path = '/'392 393-393 if is_py2:394 if isinstance(scheme, str):395 scheme = scheme.encode('utf-8')396 if isinstance(netloc, str):49 unmodified lines446 """Properly register a hook."""447 448 self.hooks[event].append(hook)449 451- def deregister_hook(self,event,hook):450+ def deregister_hook(self, event, hook):451 """Deregister a previously registered hook.452 Returns True if the hook existed, False if not.453 """454 57 unmodified lines512 # Add content-type if it wasn't explicitly provided.513 if (content_type) and (not 'content-type' in self.headers):514 self.headers['Content-Type'] = content_type515 517-516 _p = urlparse(url)517 proxy = self.proxies.get(_p.scheme)518 519 if proxy:277 unmodified lines797 # Trust that chardet isn't available or something went terribly wrong.798 except Exception:799 pass800 803-801 @property802 def text(self):803 """Content of the response, in unicode.804 38 unmodified lines843 http_error = HTTPError('%s Client Error' % self.status_code)844 http_error.response = self845 raise http_error846 850-847 elif (self.status_code >= 500) and (self.status_code < 600):848 http_error = HTTPError('%s Server Error' % self.status_code)849 http_error.response = self850 raise http_error