diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-03-16 13:01:46 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-03-19 23:54:41 +0000 |
commit | 202b7d05210cae0a781e1db11f0805519d6dc6ed (patch) | |
tree | 777c2418635f569aa368ecb376b02af4aeceb7bf /bitbake/lib/bb | |
parent | 8ded31e0526d30e3f86764288d2ae7002144bc02 (diff) | |
download | poky-202b7d05210cae0a781e1db11f0805519d6dc6ed.tar.gz |
bitbake: fetch2/wget: Cleanup module imports
(Bitbake rev: ef062a3251af474fdeb480149856be3887b8c1c9)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-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) |