diff options
author | Victor Zhestkov <Victor.Zhestkov@suse.com> | 2022-07-29 16:34:58 +0300 |
---|---|---|
committer | Neal Gompa (ニール・ゴンパ) <ngompa13@gmail.com> | 2022-09-02 10:11:29 -0400 |
commit | 28d36387da2e8a8b5fb248183c36eff9dce5634a (patch) | |
tree | 35e028660b8d8735a4875d2fc74c5eaf33cf8be0 | |
parent | eca360d187202cdf54b7c88fbe2203760d3110fb (diff) | |
download | urlgrabber-28d36387da2e8a8b5fb248183c36eff9dce5634a.tar.gz |
Fix the find_proxy bit different way
-rw-r--r-- | urlgrabber/grabber.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py index d1c83b8..741234e 100644 --- a/urlgrabber/grabber.py +++ b/urlgrabber/grabber.py @@ -983,20 +983,20 @@ class URLGrabberOptions: Use the proxies dictionary first, then libproxy. """ self.proxy = None - if scheme not in (b'ftp', b'http', b'https'): + if isinstance(scheme, bytes): + scheme = scheme.decode('utf-8') + if scheme not in ('ftp', 'http', 'https'): return if self.proxies: proxy = self.proxies.get(scheme) if proxy is None: - if scheme == b'http': - proxy = self.proxies.get('http') - elif scheme == b'https': + if scheme == 'http': proxy = self.proxies.get('https') - elif scheme == b'ftp': - proxy = self.proxies.get('ftp') + elif scheme == 'https': + proxy = self.proxies.get('http') if proxy == '_none_': - proxy = '' + proxy = None self.proxy = proxy return |