diff options
Diffstat (limited to 'bitbake/lib')
| -rw-r--r-- | bitbake/lib/bb/fetch2/wget.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index 3addb219d5..8ec5731b0c 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py | |||
| @@ -33,11 +33,14 @@ import logging | |||
| 33 | import errno | 33 | import errno |
| 34 | import bb | 34 | import bb |
| 35 | import bb.progress | 35 | import bb.progress |
| 36 | import socket | ||
| 37 | import http.client | ||
| 36 | import urllib.request, urllib.parse, urllib.error | 38 | import urllib.request, urllib.parse, urllib.error |
| 37 | from bb.fetch2 import FetchMethod | 39 | from bb.fetch2 import FetchMethod |
| 38 | from bb.fetch2 import FetchError | 40 | from bb.fetch2 import FetchError |
| 39 | from bb.fetch2 import logger | 41 | from bb.fetch2 import logger |
| 40 | from bb.fetch2 import runfetchcmd | 42 | from bb.fetch2 import runfetchcmd |
| 43 | from bb.fetch2 import FetchConnectionCache | ||
| 41 | from bb.utils import export_proxies | 44 | from bb.utils import export_proxies |
| 42 | from bs4 import BeautifulSoup | 45 | from bs4 import BeautifulSoup |
| 43 | from bs4 import SoupStrainer | 46 | from bs4 import SoupStrainer |
| @@ -132,10 +135,6 @@ class Wget(FetchMethod): | |||
| 132 | return True | 135 | return True |
| 133 | 136 | ||
| 134 | def checkstatus(self, fetch, ud, d, try_again=True): | 137 | def checkstatus(self, fetch, ud, d, try_again=True): |
| 135 | import urllib.request, urllib.error, urllib.parse, socket, http.client | ||
| 136 | from urllib.response import addinfourl | ||
| 137 | from bb.fetch2 import FetchConnectionCache | ||
| 138 | |||
| 139 | class HTTPConnectionCache(http.client.HTTPConnection): | 138 | class HTTPConnectionCache(http.client.HTTPConnection): |
| 140 | if fetch.connection_cache: | 139 | if fetch.connection_cache: |
| 141 | def connect(self): | 140 | def connect(self): |
| @@ -252,7 +251,7 @@ class Wget(FetchMethod): | |||
| 252 | pass | 251 | pass |
| 253 | closed = False | 252 | closed = False |
| 254 | 253 | ||
| 255 | resp = addinfourl(fp_dummy(), r.msg, req.get_full_url()) | 254 | resp = urllib.response.addinfourl(fp_dummy(), r.msg, req.get_full_url()) |
| 256 | resp.code = r.status | 255 | resp.code = r.status |
| 257 | resp.msg = r.reason | 256 | resp.msg = r.reason |
| 258 | 257 | ||
| @@ -326,7 +325,7 @@ class Wget(FetchMethod): | |||
| 326 | add_basic_auth(ud.user + ':' + ud.pswd, r) | 325 | add_basic_auth(ud.user + ':' + ud.pswd, r) |
| 327 | 326 | ||
| 328 | try: | 327 | try: |
| 329 | import netrc, urllib.parse | 328 | import netrc |
| 330 | n = netrc.netrc() | 329 | n = netrc.netrc() |
| 331 | login, unused, password = n.authenticators(urllib.parse.urlparse(uri).hostname) | 330 | login, unused, password = n.authenticators(urllib.parse.urlparse(uri).hostname) |
| 332 | add_basic_auth("%s:%s" % (login, password), r) | 331 | add_basic_auth("%s:%s" % (login, password), r) |
